Skip to content

Commit

Permalink
fix New func of cback drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 committed Nov 30, 2023
1 parent edae038 commit e57038b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cback/http/cback.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package cback

import (
"bytes"
"context"
"encoding/json"
"fmt"
"net/http"
Expand All @@ -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() {
Expand Down Expand Up @@ -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")
Expand Down
5 changes: 4 additions & 1 deletion cback/storage/cback.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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")
Expand Down

0 comments on commit e57038b

Please sign in to comment.