mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-23 20:49:13 -05:00
update reva and refactor config
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
committed by
David Christofas
parent
d9d7272299
commit
b64b3242e2
@@ -4,22 +4,22 @@ 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"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
// StorageStorageHomeCommand is the entrypoint for the reva-storage-home command.
|
||||
func StorageStorageHomeCommand(cfg *config.Config) *cli.Command {
|
||||
// StorageHomeCommand is the entrypoint for the storage-home command.
|
||||
func StorageHomeCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-storage-home",
|
||||
Usage: "Start storage storage service for home mount",
|
||||
Name: "storage-home",
|
||||
Usage: "Start storage and data provider for /home mount",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.StorageHomeWithConfig(cfg.Storage),
|
||||
Action: func(c *cli.Context) error {
|
||||
scfg := configureStorageStorageHome(cfg)
|
||||
scfg := configureStorageHome(cfg)
|
||||
|
||||
return cli.HandleAction(
|
||||
command.StorageHome(scfg).Action,
|
||||
@@ -29,7 +29,7 @@ func StorageStorageHomeCommand(cfg *config.Config) *cli.Command {
|
||||
}
|
||||
}
|
||||
|
||||
func configureStorageStorageHome(cfg *config.Config) *svcconfig.Config {
|
||||
func configureStorageHome(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
|
||||
@@ -46,5 +46,5 @@ func configureStorageStorageHome(cfg *config.Config) *svcconfig.Config {
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageStorageHomeCommand)
|
||||
register.AddCommand(StorageHomeCommand)
|
||||
}
|
||||
@@ -2,22 +2,22 @@ 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"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
// StorageStorageMetadataCommand is the entrypoint for the reva-storage-metadata command.
|
||||
func StorageStorageMetadataCommand(cfg *config.Config) *cli.Command {
|
||||
// StorageMetadataCommand is the entrypoint for the storage-metadata command.
|
||||
func StorageMetadataCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-storage-metadata",
|
||||
Usage: "Start storage storage service for metadata mount",
|
||||
Name: "storage-metadata",
|
||||
Usage: "Start storage and data service for metadata",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.StorageMetadata(cfg.Storage),
|
||||
Action: func(c *cli.Context) error {
|
||||
revaStorageMetadataCommand := command.StorageMetadata(configureStorageStorageMetadata(cfg))
|
||||
revaStorageMetadataCommand := command.StorageMetadata(configureStorageMetadata(cfg))
|
||||
|
||||
if err := revaStorageMetadataCommand.Before(c); err != nil {
|
||||
return err
|
||||
@@ -28,7 +28,7 @@ func StorageStorageMetadataCommand(cfg *config.Config) *cli.Command {
|
||||
}
|
||||
}
|
||||
|
||||
func configureStorageStorageMetadata(cfg *config.Config) *svcconfig.Config {
|
||||
func configureStorageMetadata(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
|
||||
@@ -45,5 +45,5 @@ func configureStorageStorageMetadata(cfg *config.Config) *svcconfig.Config {
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageStorageMetadataCommand)
|
||||
register.AddCommand(StorageMetadataCommand)
|
||||
}
|
||||
+7
-7
@@ -4,22 +4,22 @@ 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"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
// StorageStoragePublicLinkCommand is the entrypoint for the reva-storage-oc command.
|
||||
func StorageStoragePublicLinkCommand(cfg *config.Config) *cli.Command {
|
||||
// StoragePublicLinkCommand is the entrypoint for the reva-storage-oc command.
|
||||
func StoragePublicLinkCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-storage-public-link",
|
||||
Usage: "Start storage public link storage",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.StoragePublicLink(cfg.Storage),
|
||||
Action: func(c *cli.Context) error {
|
||||
scfg := configureStorageStoragePublicLink(cfg)
|
||||
scfg := configureStoragePublicLink(cfg)
|
||||
|
||||
return cli.HandleAction(
|
||||
command.StoragePublicLink(scfg).Action,
|
||||
@@ -29,7 +29,7 @@ func StorageStoragePublicLinkCommand(cfg *config.Config) *cli.Command {
|
||||
}
|
||||
}
|
||||
|
||||
func configureStorageStoragePublicLink(cfg *config.Config) *svcconfig.Config {
|
||||
func configureStoragePublicLink(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
|
||||
@@ -46,5 +46,5 @@ func configureStorageStoragePublicLink(cfg *config.Config) *svcconfig.Config {
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageStoragePublicLinkCommand)
|
||||
register.AddCommand(StoragePublicLinkCommand)
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// +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"
|
||||
)
|
||||
|
||||
// StorageStorageEOSCommand is the entrypoint for the reva-storage-oc command.
|
||||
func StorageStorageEOSCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-storage-eos",
|
||||
Usage: "Start storage storage service for eos mount",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.StorageEOSWithConfig(cfg.Storage),
|
||||
Action: func(c *cli.Context) error {
|
||||
scfg := configureStorageStorageEOS(cfg)
|
||||
|
||||
return cli.HandleAction(
|
||||
command.StorageEOS(scfg).Action,
|
||||
c,
|
||||
)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureStorageStorageEOS(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
|
||||
cfg.Storage.Tracing.Service = cfg.Tracing.Service
|
||||
}
|
||||
|
||||
return cfg.Storage
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageStorageEOSCommand)
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// +build !simple
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
"github.com/owncloud/ocis/storage/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
// StorageStorageEOSDataCommand is the entrypoint for the reva-storage-eos-data command.
|
||||
func StorageStorageEOSDataCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-storage-eos-data",
|
||||
Usage: "Start storage storage data provider for eos mount",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.StorageEOSDataWithConfig(cfg.Storage),
|
||||
Action: func(c *cli.Context) error {
|
||||
scfg := configureStorageStorageEOSData(cfg)
|
||||
|
||||
return cli.HandleAction(
|
||||
command.StorageEOSData(scfg).Action,
|
||||
c,
|
||||
)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureStorageStorageEOSData(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
|
||||
cfg.Storage.Tracing.Service = cfg.Tracing.Service
|
||||
}
|
||||
|
||||
return cfg.Storage
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageStorageEOSDataCommand)
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// +build !simple
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
"github.com/owncloud/ocis/storage/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
// StorageStorageHomeDataCommand is the entrypoint for the reva-storage-home-data command.
|
||||
func StorageStorageHomeDataCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-storage-home-data",
|
||||
Usage: "Start storage storage data provider for home mount",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.StorageHomeDataWithConfig(cfg.Storage),
|
||||
Action: func(c *cli.Context) error {
|
||||
scfg := configureStorageStorageHomeData(cfg)
|
||||
|
||||
return cli.HandleAction(
|
||||
command.StorageHomeData(scfg).Action,
|
||||
c,
|
||||
)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureStorageStorageHomeData(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
|
||||
cfg.Storage.Tracing.Service = cfg.Tracing.Service
|
||||
}
|
||||
|
||||
return cfg.Storage
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageStorageHomeDataCommand)
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// +build !simple
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
"github.com/owncloud/ocis/storage/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
// StorageStorageOCCommand is the entrypoint for the reva-storage-oc command.
|
||||
func StorageStorageOCCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-storage-oc",
|
||||
Usage: "Start storage storage service for oc mount",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.StorageOCWithConfig(cfg.Storage),
|
||||
Action: func(c *cli.Context) error {
|
||||
scfg := configureStorageStorageOC(cfg)
|
||||
|
||||
return cli.HandleAction(
|
||||
command.StorageOC(scfg).Action,
|
||||
c,
|
||||
)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureStorageStorageOC(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
|
||||
cfg.Storage.Tracing.Service = cfg.Tracing.Service
|
||||
}
|
||||
|
||||
return cfg.Storage
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageStorageOCCommand)
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// +build !simple
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
"github.com/owncloud/ocis/storage/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
// StorageStorageOCDataCommand is the entrypoint for the reva-storage-oc-data command.
|
||||
func StorageStorageOCDataCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-storage-oc-data",
|
||||
Usage: "Start storage storage data provider for oc mount",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.StorageOCDataWithConfig(cfg.Storage),
|
||||
Action: func(c *cli.Context) error {
|
||||
scfg := configureStorageStorageOCData(cfg)
|
||||
|
||||
return cli.HandleAction(
|
||||
command.StorageOCData(scfg).Action,
|
||||
c,
|
||||
)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureStorageStorageOCData(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
|
||||
cfg.Storage.Tracing.Service = cfg.Tracing.Service
|
||||
}
|
||||
|
||||
return cfg.Storage
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageStorageOCDataCommand)
|
||||
}
|
||||
@@ -4,32 +4,32 @@ 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"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
// StorageStorageRootCommand is the entrypoint for the reva-storage-root command.
|
||||
func StorageStorageRootCommand(cfg *config.Config) *cli.Command {
|
||||
// StorageUserProviderCommand is the entrypoint for the storage-userprovider command.
|
||||
func StorageUserProviderCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-storage-root",
|
||||
Usage: "Start storage root storage",
|
||||
Name: "storage-userprovider",
|
||||
Usage: "Start storage userprovider service",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.StorageRootWithConfig(cfg.Storage),
|
||||
Flags: flagset.UsersWithConfig(cfg.Storage),
|
||||
Action: func(c *cli.Context) error {
|
||||
scfg := configureStorageStorageRoot(cfg)
|
||||
scfg := configureStorageUserProvider(cfg)
|
||||
|
||||
return cli.HandleAction(
|
||||
command.StorageRoot(scfg).Action,
|
||||
command.Users(scfg).Action,
|
||||
c,
|
||||
)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureStorageStorageRoot(cfg *config.Config) *svcconfig.Config {
|
||||
func configureStorageUserProvider(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
|
||||
@@ -46,5 +46,5 @@ func configureStorageStorageRoot(cfg *config.Config) *svcconfig.Config {
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageStorageRootCommand)
|
||||
register.AddCommand(StorageUserProviderCommand)
|
||||
}
|
||||
@@ -4,25 +4,25 @@ 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"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
// StorageUsersCommand is the entrypoint for the reva-users command.
|
||||
// StorageUsersCommand is the entrypoint for the storage-users command.
|
||||
func StorageUsersCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-users",
|
||||
Usage: "Start storage users service",
|
||||
Usage: "Start storage and data provider for /users mount",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.UsersWithConfig(cfg.Storage),
|
||||
Flags: flagset.StorageUsersWithConfig(cfg.Storage),
|
||||
Action: func(c *cli.Context) error {
|
||||
scfg := configureStorageUsers(cfg)
|
||||
|
||||
return cli.HandleAction(
|
||||
command.Users(scfg).Action,
|
||||
command.StorageUsers(scfg).Action,
|
||||
c,
|
||||
)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user