Rename ocis single binary commands and flagset

This commit is contained in:
Michael Barz
2020-10-06 13:41:34 +02:00
parent e946819c3a
commit 93138c81ed
40 changed files with 905 additions and 893 deletions
+2 -2
View File
@@ -48,8 +48,8 @@ func configureProxy(cfg *config.Config) *svcconfig.Config {
cfg.Proxy.Tracing.Service = cfg.Tracing.Service
}
if cfg.Reva.Reva.JWTSecret != "" {
cfg.Proxy.TokenManager.JWTSecret = cfg.Reva.Reva.JWTSecret
if cfg.Storage.Reva.JWTSecret != "" {
cfg.Proxy.TokenManager.JWTSecret = cfg.Storage.Reva.JWTSecret
}
return cfg.Proxy
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaAuthBasicCommand is the entrypoint for the reva-auth-basic command.
func RevaAuthBasicCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-auth-basic",
Usage: "Start reva auth-basic service",
Category: "Extensions",
Flags: flagset.AuthBasicWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaAuthBasic(cfg)
return cli.HandleAction(
command.AuthBasic(scfg).Action,
c,
)
},
}
}
func configureRevaAuthBasic(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaAuthBasicCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaAuthBearerCommand is the entrypoint for the reva-auth-bearer command.
func RevaAuthBearerCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-auth-bearer",
Usage: "Start reva auth-bearer service",
Category: "Extensions",
Flags: flagset.AuthBearerWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaAuthBearer(cfg)
return cli.HandleAction(
command.AuthBearer(scfg).Action,
c,
)
},
}
}
func configureRevaAuthBearer(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaAuthBearerCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaFrontendCommand is the entrypoint for the reva-frontend command.
func RevaFrontendCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-frontend",
Usage: "Start reva frontend",
Category: "Extensions",
Flags: flagset.FrontendWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaFrontend(cfg)
return cli.HandleAction(
command.Frontend(scfg).Action,
c,
)
},
}
}
func configureRevaFrontend(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaFrontendCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaGatewayCommand is the entrypoint for the reva-gateway command.
func RevaGatewayCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-gateway",
Usage: "Start reva gateway",
Category: "Extensions",
Flags: flagset.GatewayWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaGateway(cfg)
return cli.HandleAction(
command.Gateway(scfg).Action,
c,
)
},
}
}
func configureRevaGateway(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaGatewayCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaSharingCommand is the entrypoint for the reva-sharing command.
func RevaSharingCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-sharing",
Usage: "Start reva sharing service",
Category: "Extensions",
Flags: flagset.SharingWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaSharing(cfg)
return cli.HandleAction(
command.Sharing(scfg).Action,
c,
)
},
}
}
func configureRevaSharing(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaSharingCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaStorageEOSCommand is the entrypoint for the reva-storage-oc command.
func RevaStorageEOSCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-eos",
Usage: "Start reva storage service for eos mount",
Category: "Extensions",
Flags: flagset.StorageEOSWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaStorageEOS(cfg)
return cli.HandleAction(
command.StorageEOS(scfg).Action,
c,
)
},
}
}
func configureRevaStorageEOS(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaStorageEOSCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaStorageEOSDataCommand is the entrypoint for the reva-storage-eos-data command.
func RevaStorageEOSDataCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-eos-data",
Usage: "Start reva storage data provider for eos mount",
Category: "Extensions",
Flags: flagset.StorageEOSDataWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaStorageEOSData(cfg)
return cli.HandleAction(
command.StorageEOSData(scfg).Action,
c,
)
},
}
}
func configureRevaStorageEOSData(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaStorageEOSDataCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaStorageHomeCommand is the entrypoint for the reva-storage-home command.
func RevaStorageHomeCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-home",
Usage: "Start reva storage service for home mount",
Category: "Extensions",
Flags: flagset.StorageHomeWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaStorageHome(cfg)
return cli.HandleAction(
command.StorageHome(scfg).Action,
c,
)
},
}
}
func configureRevaStorageHome(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaStorageHomeCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaStorageHomeDataCommand is the entrypoint for the reva-storage-home-data command.
func RevaStorageHomeDataCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-home-data",
Usage: "Start reva storage data provider for home mount",
Category: "Extensions",
Flags: flagset.StorageHomeDataWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaStorageHomeData(cfg)
return cli.HandleAction(
command.StorageHomeData(scfg).Action,
c,
)
},
}
}
func configureRevaStorageHomeData(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaStorageHomeDataCommand)
}
-49
View File
@@ -1,49 +0,0 @@
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaStorageMetadataCommand is the entrypoint for the reva-storage-metadata command.
func RevaStorageMetadataCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-metadata",
Usage: "Start reva storage service for metadata mount",
Category: "Extensions",
Flags: flagset.StorageMetadata(cfg.Reva),
Action: func(c *cli.Context) error {
revaStorageMetadataCommand := command.StorageMetadata(configureRevaStorageMetadata(cfg))
if err := revaStorageMetadataCommand.Before(c); err != nil {
return err
}
return cli.HandleAction(revaStorageMetadataCommand.Action, c)
},
}
}
func configureRevaStorageMetadata(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaStorageMetadataCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaStorageOCCommand is the entrypoint for the reva-storage-oc command.
func RevaStorageOCCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-oc",
Usage: "Start reva storage service for oc mount",
Category: "Extensions",
Flags: flagset.StorageOCWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaStorageOC(cfg)
return cli.HandleAction(
command.StorageOC(scfg).Action,
c,
)
},
}
}
func configureRevaStorageOC(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaStorageOCCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaStorageOCDataCommand is the entrypoint for the reva-storage-oc-data command.
func RevaStorageOCDataCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-oc-data",
Usage: "Start reva storage data provider for oc mount",
Category: "Extensions",
Flags: flagset.StorageOCDataWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaStorageOCData(cfg)
return cli.HandleAction(
command.StorageOCData(scfg).Action,
c,
)
},
}
}
func configureRevaStorageOCData(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaStorageOCDataCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaStoragePublicLinkCommand is the entrypoint for the reva-storage-oc command.
func RevaStoragePublicLinkCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-public-link",
Usage: "Start reva public link storage",
Category: "Extensions",
Flags: flagset.StoragePublicLink(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaStoragePublicLink(cfg)
return cli.HandleAction(
command.StoragePublicLink(scfg).Action,
c,
)
},
}
}
func configureRevaStoragePublicLink(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaStoragePublicLinkCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaStorageRootCommand is the entrypoint for the reva-storage-root command.
func RevaStorageRootCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-root",
Usage: "Start reva root storage",
Category: "Extensions",
Flags: flagset.StorageRootWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaStorageRoot(cfg)
return cli.HandleAction(
command.StorageRoot(scfg).Action,
c,
)
},
}
}
func configureRevaStorageRoot(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaStorageRootCommand)
}
-50
View File
@@ -1,50 +0,0 @@
// +build !simple
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// RevaUsersCommand is the entrypoint for the reva-users command.
func RevaUsersCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-users",
Usage: "Start reva users service",
Category: "Extensions",
Flags: flagset.UsersWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaUsers(cfg)
return cli.HandleAction(
command.Users(scfg).Action,
c,
)
},
}
}
func configureRevaUsers(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Reva.Tracing.Type = cfg.Tracing.Type
cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Reva.Tracing.Collector = cfg.Tracing.Collector
cfg.Reva.Tracing.Service = cfg.Tracing.Service
}
return cfg.Reva
}
func init() {
register.AddCommand(RevaUsersCommand)
}
+4 -4
View File
@@ -4,12 +4,12 @@ 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/ocis/pkg/version"
"github.com/owncloud/ocis/settings/pkg/command"
svcconfig "github.com/owncloud/ocis/settings/pkg/config"
"github.com/owncloud/ocis/settings/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// SettingsCommand is the entry point for the settings command.
@@ -48,8 +48,8 @@ func configureSettings(cfg *config.Config) *svcconfig.Config {
cfg.Settings.Tracing.Service = cfg.Tracing.Service
}
if cfg.Reva.Reva.JWTSecret != "" {
cfg.Settings.TokenManager.JWTSecret = cfg.Reva.Reva.JWTSecret
if cfg.Storage.Reva.JWTSecret != "" {
cfg.Settings.TokenManager.JWTSecret = cfg.Storage.Reva.JWTSecret
}
return cfg.Settings
+50
View File
@@ -0,0 +1,50 @@
// +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"
)
// StorageAuthBasicCommand is the entrypoint for the reva-auth-basic command.
func StorageAuthBasicCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-auth-basic",
Usage: "Start storage auth-basic service",
Category: "Extensions",
Flags: flagset.AuthBasicWithConfig(cfg.Storage),
Action: func(c *cli.Context) error {
scfg := configureStorageAuthBasic(cfg)
return cli.HandleAction(
command.AuthBasic(scfg).Action,
c,
)
},
}
}
func configureStorageAuthBasic(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(StorageAuthBasicCommand)
}
+50
View File
@@ -0,0 +1,50 @@
// +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"
)
// StorageAuthBearerCommand is the entrypoint for the reva-auth-bearer command.
func StorageAuthBearerCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-auth-bearer",
Usage: "Start storage auth-bearer service",
Category: "Extensions",
Flags: flagset.AuthBearerWithConfig(cfg.Storage),
Action: func(c *cli.Context) error {
scfg := configureStorageAuthBearer(cfg)
return cli.HandleAction(
command.AuthBearer(scfg).Action,
c,
)
},
}
}
func configureStorageAuthBearer(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(StorageAuthBearerCommand)
}
+50
View File
@@ -0,0 +1,50 @@
// +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"
)
// StorageFrontendCommand is the entrypoint for the reva-frontend command.
func StorageFrontendCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-frontend",
Usage: "Start storage frontend",
Category: "Extensions",
Flags: flagset.FrontendWithConfig(cfg.Storage),
Action: func(c *cli.Context) error {
scfg := configureStorageFrontend(cfg)
return cli.HandleAction(
command.Frontend(scfg).Action,
c,
)
},
}
}
func configureStorageFrontend(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(StorageFrontendCommand)
}
+50
View File
@@ -0,0 +1,50 @@
// +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"
)
// StorageGatewayCommand is the entrypoint for the reva-gateway command.
func StorageGatewayCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-gateway",
Usage: "Start storage gateway",
Category: "Extensions",
Flags: flagset.GatewayWithConfig(cfg.Storage),
Action: func(c *cli.Context) error {
scfg := configureStorageGateway(cfg)
return cli.HandleAction(
command.Gateway(scfg).Action,
c,
)
},
}
}
func configureStorageGateway(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(StorageGatewayCommand)
}
+50
View File
@@ -0,0 +1,50 @@
// +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"
)
// StorageSharingCommand is the entrypoint for the reva-sharing command.
func StorageSharingCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-sharing",
Usage: "Start storage sharing service",
Category: "Extensions",
Flags: flagset.SharingWithConfig(cfg.Storage),
Action: func(c *cli.Context) error {
scfg := configureStorageSharing(cfg)
return cli.HandleAction(
command.Sharing(scfg).Action,
c,
)
},
}
}
func configureStorageSharing(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(StorageSharingCommand)
}
+50
View File
@@ -0,0 +1,50 @@
// +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)
}
+50
View File
@@ -0,0 +1,50 @@
// +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)
}
+50
View File
@@ -0,0 +1,50 @@
// +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"
)
// StorageStorageHomeCommand is the entrypoint for the reva-storage-home command.
func StorageStorageHomeCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-storage-home",
Usage: "Start storage storage service for home mount",
Category: "Extensions",
Flags: flagset.StorageHomeWithConfig(cfg.Storage),
Action: func(c *cli.Context) error {
scfg := configureStorageStorageHome(cfg)
return cli.HandleAction(
command.StorageHome(scfg).Action,
c,
)
},
}
}
func configureStorageStorageHome(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(StorageStorageHomeCommand)
}
@@ -0,0 +1,50 @@
// +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)
}
@@ -0,0 +1,49 @@
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"
)
// StorageStorageMetadataCommand is the entrypoint for the reva-storage-metadata command.
func StorageStorageMetadataCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-storage-metadata",
Usage: "Start storage storage service for metadata mount",
Category: "Extensions",
Flags: flagset.StorageMetadata(cfg.Storage),
Action: func(c *cli.Context) error {
revaStorageMetadataCommand := command.StorageMetadata(configureStorageStorageMetadata(cfg))
if err := revaStorageMetadataCommand.Before(c); err != nil {
return err
}
return cli.HandleAction(revaStorageMetadataCommand.Action, c)
},
}
}
func configureStorageStorageMetadata(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(StorageStorageMetadataCommand)
}
+50
View File
@@ -0,0 +1,50 @@
// +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)
}
+50
View File
@@ -0,0 +1,50 @@
// +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)
}
@@ -0,0 +1,50 @@
// +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"
)
// StorageStoragePublicLinkCommand is the entrypoint for the reva-storage-oc command.
func StorageStoragePublicLinkCommand(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)
return cli.HandleAction(
command.StoragePublicLink(scfg).Action,
c,
)
},
}
}
func configureStorageStoragePublicLink(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(StorageStoragePublicLinkCommand)
}
+50
View File
@@ -0,0 +1,50 @@
// +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"
)
// StorageStorageRootCommand is the entrypoint for the reva-storage-root command.
func StorageStorageRootCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-storage-root",
Usage: "Start storage root storage",
Category: "Extensions",
Flags: flagset.StorageRootWithConfig(cfg.Storage),
Action: func(c *cli.Context) error {
scfg := configureStorageStorageRoot(cfg)
return cli.HandleAction(
command.StorageRoot(scfg).Action,
c,
)
},
}
}
func configureStorageStorageRoot(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(StorageStorageRootCommand)
}
+50
View File
@@ -0,0 +1,50 @@
// +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"
)
// StorageUsersCommand is the entrypoint for the reva-users command.
func StorageUsersCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-users",
Usage: "Start storage users service",
Category: "Extensions",
Flags: flagset.UsersWithConfig(cfg.Storage),
Action: func(c *cli.Context) error {
scfg := configureStorageUsers(cfg)
return cli.HandleAction(
command.Users(scfg).Action,
c,
)
},
}
}
func configureStorageUsers(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(StorageUsersCommand)
}