mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-29 15:29:52 -05:00
minor refactor
This commit is contained in:
@@ -19,7 +19,6 @@ type Service struct{}
|
||||
|
||||
// Set implements the SettingsServiceHandler interface generated on accounts.pb.micro.go
|
||||
func (s Service) Set(c context.Context, req *proto.Record, res *proto.Record) error {
|
||||
// TODO this should be a globally initialized struct
|
||||
st := store.New()
|
||||
|
||||
settingsJSON, err := json.Marshal(req.Payload)
|
||||
|
||||
@@ -23,16 +23,18 @@ type Store struct {
|
||||
// New returns a new file system store manager
|
||||
// TODO add mountPath as a flag. Accept a *config argument
|
||||
func New() Store {
|
||||
store := Store{
|
||||
logger: olog.NewLogger(),
|
||||
}
|
||||
|
||||
// default to the current working directory if not configured
|
||||
dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
|
||||
if err != nil {
|
||||
// TODO log error
|
||||
// TODO deal with this
|
||||
}
|
||||
return Store{
|
||||
mountPath: dir,
|
||||
logger: olog.NewLogger(),
|
||||
store.logger.Err(err).Msg("initializing the accounts store")
|
||||
}
|
||||
store.mountPath = dir
|
||||
|
||||
return store
|
||||
}
|
||||
|
||||
// Init implements the store interface
|
||||
|
||||
Reference in New Issue
Block a user