updgrade the micro/cli dependency

This commit is contained in:
David Christofas
2020-01-30 13:22:31 +01:00
parent 20455a2e90
commit 15294bd48f
7 changed files with 36 additions and 30 deletions
+3 -3
View File
@@ -4,14 +4,14 @@ import (
"fmt"
"net/http"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-ocs/pkg/config"
"github.com/owncloud/ocis-ocs/pkg/flagset"
)
// Health is the entrypoint for the health command.
func Health(cfg *config.Config) cli.Command {
return cli.Command{
func Health(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "health",
Usage: "Check health status",
Flags: flagset.HealthWithConfig(cfg),
+3 -3
View File
@@ -4,7 +4,7 @@ import (
"os"
"strings"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-ocs/pkg/config"
"github.com/owncloud/ocis-ocs/pkg/flagset"
"github.com/owncloud/ocis-ocs/pkg/version"
@@ -22,7 +22,7 @@ func Execute() error {
Usage: "Serve OCS API for oCIS",
Compiled: version.Compiled(),
Authors: []cli.Author{
Authors: []*cli.Author{
{
Name: "ownCloud GmbH",
Email: "support@owncloud.com",
@@ -73,7 +73,7 @@ func Execute() error {
return nil
},
Commands: []cli.Command{
Commands: []*cli.Command{
Server(cfg),
Health(cfg),
},
+3 -3
View File
@@ -10,7 +10,7 @@ import (
"contrib.go.opencensus.io/exporter/jaeger"
"contrib.go.opencensus.io/exporter/ocagent"
"contrib.go.opencensus.io/exporter/zipkin"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
openzipkin "github.com/openzipkin/zipkin-go"
zipkinhttp "github.com/openzipkin/zipkin-go/reporter/http"
@@ -24,8 +24,8 @@ import (
)
// Server is the entrypoint for the server command.
func Server(cfg *config.Config) cli.Command {
return cli.Command{
func Server(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "server",
Usage: "Start integrated server",
Flags: flagset.ServerWithConfig(cfg),
+20 -20
View File
@@ -1,7 +1,7 @@
package flagset
import (
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-ocs/pkg/config"
)
@@ -12,26 +12,26 @@ func RootWithConfig(cfg *config.Config) []cli.Flag {
Name: "config-file",
Value: "",
Usage: "Path to config file",
EnvVar: "OCS_CONFIG_FILE",
EnvVars: []string{"OCS_CONFIG_FILE"},
Destination: &cfg.File,
},
&cli.StringFlag{
Name: "log-level",
Value: "info",
Usage: "Set logging level",
EnvVar: "OCS_LOG_LEVEL",
EnvVars: []string{"OCS_LOG_LEVEL"},
Destination: &cfg.Log.Level,
},
&cli.BoolTFlag{
&cli.BoolFlag{
Name: "log-pretty",
Usage: "Enable pretty logging",
EnvVar: "OCS_LOG_PRETTY",
EnvVars: []string{"OCS_LOG_PRETTY"},
Destination: &cfg.Log.Pretty,
},
&cli.BoolTFlag{
&cli.BoolFlag{
Name: "log-color",
Usage: "Enable colored logging",
EnvVar: "OCS_LOG_COLOR",
EnvVars: []string{"OCS_LOG_COLOR"},
Destination: &cfg.Log.Color,
},
}
@@ -44,7 +44,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9114",
Usage: "Address to debug endpoint",
EnvVar: "OCS_DEBUG_ADDR",
EnvVars: []string{"OCS_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
}
@@ -56,82 +56,82 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
&cli.BoolFlag{
Name: "tracing-enabled",
Usage: "Enable sending traces",
EnvVar: "OCS_TRACING_ENABLED",
EnvVars: []string{"OCS_TRACING_ENABLED"},
Destination: &cfg.Tracing.Enabled,
},
&cli.StringFlag{
Name: "tracing-type",
Value: "jaeger",
Usage: "Tracing backend type",
EnvVar: "OCS_TRACING_TYPE",
EnvVars: []string{"OCS_TRACING_TYPE"},
Destination: &cfg.Tracing.Type,
},
&cli.StringFlag{
Name: "tracing-endpoint",
Value: "",
Usage: "Endpoint for the agent",
EnvVar: "OCS_TRACING_ENDPOINT",
EnvVars: []string{"OCS_TRACING_ENDPOINT"},
Destination: &cfg.Tracing.Endpoint,
},
&cli.StringFlag{
Name: "tracing-collector",
Value: "",
Usage: "Endpoint for the collector",
EnvVar: "OCS_TRACING_COLLECTOR",
EnvVars: []string{"OCS_TRACING_COLLECTOR"},
Destination: &cfg.Tracing.Collector,
},
&cli.StringFlag{
Name: "tracing-service",
Value: "ocs",
Usage: "Service name for tracing",
EnvVar: "OCS_TRACING_SERVICE",
EnvVars: []string{"OCS_TRACING_SERVICE"},
Destination: &cfg.Tracing.Service,
},
&cli.StringFlag{
Name: "debug-addr",
Value: "0.0.0.0:9114",
Usage: "Address to bind debug server",
EnvVar: "OCS_DEBUG_ADDR",
EnvVars: []string{"OCS_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
&cli.StringFlag{
Name: "debug-token",
Value: "",
Usage: "Token to grant metrics access",
EnvVar: "OCS_DEBUG_TOKEN",
EnvVars: []string{"OCS_DEBUG_TOKEN"},
Destination: &cfg.Debug.Token,
},
&cli.BoolFlag{
Name: "debug-pprof",
Usage: "Enable pprof debugging",
EnvVar: "OCS_DEBUG_PPROF",
EnvVars: []string{"OCS_DEBUG_PPROF"},
Destination: &cfg.Debug.Pprof,
},
&cli.BoolFlag{
Name: "debug-zpages",
Usage: "Enable zpages debugging",
EnvVar: "OCS_DEBUG_ZPAGES",
EnvVars: []string{"OCS_DEBUG_ZPAGES"},
Destination: &cfg.Debug.Zpages,
},
&cli.StringFlag{
Name: "http-addr",
Value: "0.0.0.0:9110",
Usage: "Address to bind http server",
EnvVar: "OCS_HTTP_ADDR",
EnvVars: []string{"OCS_HTTP_ADDR"},
Destination: &cfg.HTTP.Addr,
},
&cli.StringFlag{
Name: "http-namespace",
Value: "com.owncloud.web",
Usage: "Set the base namespace for the http namespace",
EnvVar: "OCS_NAMESPACE",
EnvVars: []string{"OCS_NAMESPACE"},
Destination: &cfg.HTTP.Namespace,
},
&cli.StringFlag{
Name: "http-root",
Value: "/",
Usage: "Root path of http server",
EnvVar: "OCS_HTTP_ROOT",
EnvVars: []string{"OCS_HTTP_ROOT"},
Destination: &cfg.HTTP.Root,
},
}
+1 -1
View File
@@ -3,7 +3,7 @@ package http
import (
"context"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-ocs/pkg/config"
"github.com/owncloud/ocis-ocs/pkg/metrics"
"github.com/owncloud/ocis-pkg/log"