mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-06 04:49:48 -06:00
storage: add group provider service and sharing SQL driver
This commit is contained in:
45
ocis/pkg/command/storagegroupprovider.go
Normal file
45
ocis/pkg/command/storagegroupprovider.go
Normal file
@@ -0,0 +1,45 @@
|
||||
// +build !simple
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
"github.com/owncloud/ocis/storage/pkg/flagset"
|
||||
)
|
||||
|
||||
// StorageGroupProviderCommand is the entrypoint for the storage-groupprovider command.
|
||||
func StorageGroupProviderCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-groupprovider",
|
||||
Usage: "Start storage groupprovider service",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.GroupsWithConfig(cfg.Storage),
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Groups(configureStorageGroupProvider(cfg))
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureStorageGroupProvider(cfg *config.Config) *svcconfig.Config {
|
||||
cfg.Storage.Log.Level = cfg.Log.Level
|
||||
cfg.Storage.Log.Pretty = cfg.Log.Pretty
|
||||
cfg.Storage.Log.Color = cfg.Log.Color
|
||||
|
||||
if cfg.Tracing.Enabled {
|
||||
cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled
|
||||
cfg.Storage.Tracing.Type = cfg.Tracing.Type
|
||||
cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint
|
||||
cfg.Storage.Tracing.Collector = cfg.Tracing.Collector
|
||||
}
|
||||
|
||||
return cfg.Storage
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageGroupProviderCommand)
|
||||
}
|
||||
Reference in New Issue
Block a user