Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins #4073

Merged
merged 11 commits into from
Jul 20, 2023
Merged

Plugins #4073

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ BUILD_FLAGS = "`[[ -z "$(STATIC)" ]] && echo "" || echo "-extldflags=-static"` -

.PHONY: revad
revad:
go build -ldflags $(BUILD_FLAGS) -o ./cmd/revad/revad ./cmd/revad
go build -ldflags $(BUILD_FLAGS) -o ./cmd/revad/revad ./cmd/revad/main

.PHONY: revad-ceph
revad-ceph:
go build -ldflags $(BUILD_FLAGS) -tags ceph -o ./cmd/revad/revad ./cmd/revad
go build -ldflags $(BUILD_FLAGS) -tags ceph -o ./cmd/revad/revad ./cmd/revad/main

.PHONY: reva
reva:
Expand Down
7 changes: 7 additions & 0 deletions changelog/unreleased/plugins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Plugins

Adds a plugin system for allowing the creation of external
plugins for different plugable components in reva,
for example grpc drivers, http services and middlewares.

https://github.com/cs3org/reva/pull/4073
4 changes: 2 additions & 2 deletions cmd/revad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

package main
package revadcmd

import (
"flag"
Expand Down Expand Up @@ -55,7 +55,7 @@ var (
revaProcs []*runtime.Reva
)

func main() {
func Main() {
flag.Parse()

// initialize the global system information
Expand Down
12 changes: 4 additions & 8 deletions pkg/plugin/registry.go → cmd/revad/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

package plugin
package main

import "github.com/hashicorp/go-plugin"
import revadcmd "github.com/cs3org/reva/cmd/revad"

// PluginMap is a map containing all the plugins.
var PluginMap = map[string]plugin.Plugin{}

// Register registers the plugin.
func Register(name string, plugin plugin.Plugin) {
PluginMap[name] = plugin
func main() {
revadcmd.Main()
}
2 changes: 1 addition & 1 deletion docker/Dockerfile.revad
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ENV CGO_ENABLED 1

RUN apk add --no-cache gcc musl-dev

RUN go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.version=$VERSION -X main.goVersion=`go version | awk '{print $3}'` -X main.buildDate=`date +%FT%T%z`" -o ./cmd/revad/revad ./cmd/revad
RUN go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.version=$VERSION -X main.goVersion=`go version | awk '{print $3}'` -X main.buildDate=`date +%FT%T%z`" -o ./cmd/revad/revad ./cmd/revad/main

FROM alpine:3.16

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.revad-eos
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ENV CGO_ENABLED 1

RUN apk add --no-cache gcc musl-dev

RUN go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.version=$VERSION -X main.goVersion=`go version | awk '{print $3}'` -X main.buildDate=`date +%FT%T%z`" -o ./cmd/revad/revad ./cmd/revad
RUN go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.version=$VERSION -X main.goVersion=`go version | awk '{print $3}'` -X main.buildDate=`date +%FT%T%z`" -o ./cmd/revad/revad ./cmd/revad/main

FROM gitlab-registry.cern.ch/dss/eos/eos-all:4.8.91

Expand Down
126 changes: 0 additions & 126 deletions docs/content/en/docs/concepts/plugins.md

This file was deleted.

174 changes: 0 additions & 174 deletions examples/plugin/json/json.go

This file was deleted.

15 changes: 0 additions & 15 deletions examples/plugin/plugin.toml

This file was deleted.

Loading