Skip to content

Commit

Permalink
Plugins (cs3org#4073)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 authored and Adriana Baldacchino committed Aug 3, 2023
1 parent 9d6598e commit b3625e5
Show file tree
Hide file tree
Showing 45 changed files with 593 additions and 970 deletions.
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

0 comments on commit b3625e5

Please sign in to comment.