Rename commands and flagset

This commit is contained in:
Michael Barz
2020-10-06 13:41:34 +02:00
parent 9ff3ffe19f
commit e946819c3a
47 changed files with 471 additions and 471 deletions
+7 -7
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// AuthBasic is the entrypoint for the auth-basic command.
func AuthBasic(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "auth-basic",
Usage: "Start reva authprovider for basic auth",
Usage: "Start authprovider for basic auth",
Flags: flagset.AuthBasicWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.AuthBasic.Services = c.StringSlice("service")
@@ -35,17 +35,17 @@ func AuthBasic(cfg *config.Config) *cli.Command {
case "agent":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
default:
logger.Warn().
+7 -7
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// AuthBearer is the entrypoint for the auth-bearer command.
func AuthBearer(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "auth-bearer",
Usage: "Start reva authprovider for bearer auth",
Usage: "Start authprovider for bearer auth",
Flags: flagset.AuthBearerWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.AuthBearer.Services = c.StringSlice("service")
@@ -35,17 +35,17 @@ func AuthBearer(cfg *config.Config) *cli.Command {
case "agent":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
default:
logger.Warn().
+1 -1
View File
@@ -1,7 +1,7 @@
package command
import (
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/storage/pkg/config"
)
func drivers(cfg *config.Config) map[string]interface{} {
+6 -6
View File
@@ -13,16 +13,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// Frontend is the entrypoint for the frontend command.
func Frontend(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "frontend",
Usage: "Start reva frontend service",
Usage: "Start frontend service",
Flags: flagset.FrontendWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.Frontend.Services = c.StringSlice("service")
@@ -42,7 +42,7 @@ func Frontend(cfg *config.Config) *cli.Command {
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
@@ -127,7 +127,7 @@ func Frontend(cfg *config.Config) *cli.Command {
},
"ocdav": map[string]interface{}{
"prefix": cfg.Reva.Frontend.OCDavPrefix,
"chunk_folder": "/var/tmp/reva/chunks",
"chunk_folder": "/var/tmp/ocis/chunks",
"files_namespace": cfg.Reva.OCDav.DavFilesNamespace,
"webdav_namespace": cfg.Reva.OCDav.WebdavNamespace,
"timeout": 86400,
+7 -7
View File
@@ -12,17 +12,17 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/ocis-reva/pkg/service/external"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/service/external"
)
// Gateway is the entrypoint for the gateway command.
func Gateway(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "gateway",
Usage: "Start reva gateway",
Usage: "Start gateway",
Flags: flagset.GatewayWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.Gateway.Services = c.StringSlice("service")
@@ -43,7 +43,7 @@ func Gateway(cfg *config.Config) *cli.Command {
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
@@ -140,7 +140,7 @@ func Gateway(cfg *config.Config) *cli.Command {
gr.Add(func() error {
err := external.RegisterGRPCEndpoint(
ctx,
"com.owncloud.reva",
"com.owncloud.storage",
uuid.String(),
cfg.Reva.Gateway.Addr,
logger,
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"net/http"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
)
// Health is the entrypoint for the health command.
+7 -7
View File
@@ -6,20 +6,20 @@ import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/version"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/version"
"github.com/spf13/viper"
)
// Execute is the entry point for the ocis-reva command.
// Execute is the entry point for the storage command.
func Execute() error {
cfg := config.New()
app := &cli.App{
Name: "storage",
Version: version.String,
Usage: "Example service for Reva/oCIS",
Usage: "Storage service for oCIS",
Compiled: version.Compiled(),
Authors: []*cli.Author{
@@ -41,7 +41,7 @@ func Execute() error {
if c.IsSet("config-file") {
viper.SetConfigFile(c.String("config-file"))
} else {
viper.SetConfigName("reva")
viper.SetConfigName("storage")
viper.AddConfigPath("/etc/ocis")
viper.AddConfigPath("$HOME/.ocis")
@@ -109,7 +109,7 @@ func Execute() error {
// NewLogger initializes a service-specific logger instance.
func NewLogger(cfg *config.Config) log.Logger {
return log.NewLogger(
log.Name("reva"),
log.Name("storage"),
log.Level(cfg.Log.Level),
log.Pretty(cfg.Log.Pretty),
log.Color(cfg.Log.Color),
+5 -5
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// Sharing is the entrypoint for the sharing command.
func Sharing(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "sharing",
Usage: "Start reva sharing service",
Usage: "Start sharing service",
Flags: flagset.SharingWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.Sharing.Services = c.StringSlice("service")
@@ -40,7 +40,7 @@ func Sharing(cfg *config.Config) *cli.Command {
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
+7 -7
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// StorageEOS is the entrypoint for the storage-eos command.
func StorageEOS(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-eos",
Usage: "Start reva storage-eos service",
Usage: "Start storage-eos service",
Flags: flagset.StorageEOSWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageEOS.Services = c.StringSlice("service")
@@ -35,17 +35,17 @@ func StorageEOS(cfg *config.Config) *cli.Command {
case "agent":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
default:
logger.Warn().
+5 -5
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// StorageEOSData is the entrypoint for the storage-oc-data command.
func StorageEOSData(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-eos-data",
Usage: "Start reva storage-eos-data service",
Usage: "Start storage-eos-data service",
Flags: flagset.StorageEOSDataWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageEOSData.Services = c.StringSlice("service")
@@ -40,7 +40,7 @@ func StorageEOSData(cfg *config.Config) *cli.Command {
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
+7 -7
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// StorageHome is the entrypoint for the storage-home command.
func StorageHome(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-home",
Usage: "Start reva storage-home service",
Usage: "Start storage-home service",
Flags: flagset.StorageHomeWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageHome.Services = c.StringSlice("service")
@@ -35,17 +35,17 @@ func StorageHome(cfg *config.Config) *cli.Command {
case "agent":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
default:
logger.Warn().
+7 -7
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// StorageHomeData is the entrypoint for the storage-home-data command.
func StorageHomeData(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-home-data",
Usage: "Start reva storage-home-data service",
Usage: "Start storage-home-data service",
Flags: flagset.StorageHomeDataWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageHomeData.Services = c.StringSlice("service")
@@ -35,17 +35,17 @@ func StorageHomeData(cfg *config.Config) *cli.Command {
case "agent":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
default:
logger.Warn().
+7 -7
View File
@@ -11,18 +11,18 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// StorageMetadata the entrypoint for the reva-storage-metadata command.
// StorageMetadata the entrypoint for the storage-storage-metadata command.
//
// It provides a ocis-specific storage store metadata (shares,account,settings...)
func StorageMetadata(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-metadata",
Usage: "Start reva storage-metadata service",
Name: "storage-metadata",
Usage: "Start storage-metadata service",
Flags: flagset.StorageMetadata(cfg),
Category: "Extensions",
Before: func(c *cli.Context) error {
@@ -48,7 +48,7 @@ func StorageMetadata(cfg *config.Config) *cli.Command {
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
+5 -5
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// StorageOC is the entrypoint for the storage-oc command.
func StorageOC(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-oc",
Usage: "Start reva storage-oc service",
Usage: "Start storage-oc service",
Flags: flagset.StorageOCWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageOC.Services = c.StringSlice("service")
@@ -40,7 +40,7 @@ func StorageOC(cfg *config.Config) *cli.Command {
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
+5 -5
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// StorageOCData is the entrypoint for the storage-oc-data command.
func StorageOCData(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-oc-data",
Usage: "Start reva storage-oc-data service",
Usage: "Start storage-oc-data service",
Flags: flagset.StorageOCDataWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageOCData.Services = c.StringSlice("service")
@@ -40,7 +40,7 @@ func StorageOCData(cfg *config.Config) *cli.Command {
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
+6 -6
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// StoragePublicLink is the entrypoint for the reva-storage-public-link command.
func StoragePublicLink(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-public-link",
Usage: "Start reva storage-public-link service",
Name: "storage-public-link",
Usage: "Start storage-public-link service",
Flags: flagset.StoragePublicLink(cfg),
Category: "Extensions",
Action: func(c *cli.Context) error {
@@ -36,7 +36,7 @@ func StoragePublicLink(cfg *config.Config) *cli.Command {
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
+7 -7
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// StorageRoot is the entrypoint for the storage-root command.
func StorageRoot(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-root",
Usage: "Start reva storage-root service",
Usage: "Start storage-root service",
Flags: flagset.StorageRootWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageRoot.Services = c.StringSlice("service")
@@ -35,17 +35,17 @@ func StorageRoot(cfg *config.Config) *cli.Command {
case "agent":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().
Str("type", t).
Msg("Reva only supports the jaeger tracing backend")
Msg("Storage only supports the jaeger tracing backend")
default:
logger.Warn().
+5 -5
View File
@@ -11,16 +11,16 @@ import (
"github.com/gofrs/uuid"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/ocis-reva/pkg/config"
"github.com/owncloud/ocis/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/flagset"
"github.com/owncloud/ocis/storage/pkg/server/debug"
)
// Users is the entrypoint for the sharing command.
func Users(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "users",
Usage: "Start reva users service",
Usage: "Start users service",
Flags: flagset.UsersWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.Users.Services = c.StringSlice("service")
@@ -40,7 +40,7 @@ func Users(cfg *config.Config) *cli.Command {
case "jaeger":
logger.Info().
Str("type", t).
Msg("configuring reva to use the jaeger tracing backend")
Msg("configuring storage to use the jaeger tracing backend")
case "zipkin":
logger.Error().