From e57038b276e94bd89a2607af8f580c849e5595a6 Mon Sep 17 00:00:00 2001 From: Gianmaria Del Monte Date: Thu, 30 Nov 2023 11:53:21 +0100 Subject: [PATCH] fix New func of cback drivers --- cback/http/cback.go | 6 ++++-- cback/storage/cback.go | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cback/http/cback.go b/cback/http/cback.go index 03a9696..bf2be87 100644 --- a/cback/http/cback.go +++ b/cback/http/cback.go @@ -20,6 +20,7 @@ package cback import ( "bytes" + "context" "encoding/json" "fmt" "net/http" @@ -41,7 +42,6 @@ import ( "github.com/go-chi/chi/v5" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" - "github.com/rs/zerolog" ) func init() { @@ -78,8 +78,10 @@ func (svc) RevaPlugin() reva.PluginInfo { } } +var _ global.NewService = New + // New returns a new cback http service. -func New(m map[string]interface{}, log *zerolog.Logger) (global.Service, error) { +func New(ctx context.Context, m map[string]interface{}) (global.Service, error) { c := &config{} if err := mapstructure.Decode(m, c); err != nil { return nil, errors.Wrap(err, "cback: error decodinf config") diff --git a/cback/storage/cback.go b/cback/storage/cback.go index cffe478..3382b43 100644 --- a/cback/storage/cback.go +++ b/cback/storage/cback.go @@ -43,6 +43,7 @@ import ( "github.com/cs3org/reva/pkg/errtypes" "github.com/cs3org/reva/pkg/mime" "github.com/cs3org/reva/pkg/storage" + "github.com/cs3org/reva/pkg/storage/fs/registry" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" ) @@ -59,9 +60,11 @@ func init() { reva.RegisterPlugin(fs{}) } +var _ registry.NewFunc = New + // New returns an implementation to the storage.FS interface that expose // the snapshots stored in cback. -func New(m map[string]interface{}) (storage.FS, error) { +func New(_ context.Context, m map[string]interface{}) (storage.FS, error) { c := &Config{} if err := mapstructure.Decode(m, c); err != nil { return nil, errors.Wrap(err, "cback: error decoding config")