Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Upgrade micro/cli to v2 #24

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/go-chi/render v1.0.1
github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/micro/cli v0.2.0
github.com/micro/cli/v2 v2.1.1
github.com/ogier/pflag v0.0.1 // indirect
github.com/oklog/run v1.0.0
github.com/openzipkin/zipkin-go v0.2.2
Expand Down
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMElOWxok=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7 h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
Expand Down Expand Up @@ -430,6 +431,8 @@ github.com/mholt/certmagic v0.7.5/go.mod h1:91uJzK5K8IWtYQqTi5R2tsxV1pCde+wdGfaR
github.com/mholt/certmagic v0.8.3/go.mod h1:91uJzK5K8IWtYQqTi5R2tsxV1pCde+wdGfaRaOZi6aQ=
github.com/micro/cli v0.2.0 h1:ut3rV5JWqZjsXIa2MvGF+qMUP8DAUTvHX9Br5gO4afA=
github.com/micro/cli v0.2.0/go.mod h1:jRT9gmfVKWSS6pkKcXQ8YhUyj6bzwxK8Fp5b0Y7qNnk=
github.com/micro/cli/v2 v2.1.1 h1:uFw0SMIKmGuyHIm8lXns/NOn7V62bM5y7DnlxUM+BEQ=
github.com/micro/cli/v2 v2.1.1/go.mod h1:EguNh6DAoWKm9nmk+k/Rg0H3lQnDxqzu5x5srOtGtYg=
github.com/micro/go-micro v1.16.0/go.mod h1:A0F58bHLh2m0LAI9QyhvmbN8c1cxhAZo3cM6s+iDsrM=
github.com/micro/go-micro v1.17.1 h1:BhwC4Lnwr3hdci9T8kN5MEabKS+CT0QT0YH4hinTdNs=
github.com/micro/go-micro v1.17.1/go.mod h1:klwUJL1gkdY1MHFyz+fFJXn52dKcty4hoe95Mp571AA=
Expand Down Expand Up @@ -591,6 +594,7 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.17.2 h1:RMRHFw2+wF7LO0QqtELQwo8hqSmqISyCJeFeAAuWcRo=
github.com/rs/zerolog v1.17.2/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
Expand All @@ -602,6 +606,7 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
Expand Down
2 changes: 1 addition & 1 deletion pkg/command/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-graph/pkg/config"
"github.com/owncloud/ocis-graph/pkg/flagset"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"strings"

"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-graph/pkg/config"
"github.com/owncloud/ocis-graph/pkg/flagset"
"github.com/owncloud/ocis-graph/pkg/version"
Expand Down
2 changes: 1 addition & 1 deletion pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
58 changes: 29 additions & 29 deletions pkg/flagset/flagset.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package flagset

import (
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-graph/pkg/config"
)

Expand All @@ -12,26 +12,26 @@ func RootWithConfig(cfg *config.Config) []cli.Flag {
Name: "config-file",
Value: "",
Usage: "Path to config file",
EnvVar: "GRAPH_CONFIG_FILE",
EnvVars: []string{"GRAPH_CONFIG_FILE"},
Destination: &cfg.File,
},
&cli.StringFlag{
Name: "log-level",
Value: "info",
Usage: "Set logging level",
EnvVar: "GRAPH_LOG_LEVEL",
EnvVars: []string{"GRAPH_LOG_LEVEL"},
Destination: &cfg.Log.Level,
},
&cli.BoolTFlag{
&cli.BoolFlag{
Name: "log-pretty",
Usage: "Enable pretty logging",
EnvVar: "GRAPH_LOG_PRETTY",
EnvVars: []string{"GRAPH_LOG_PRETTY"},
Destination: &cfg.Log.Pretty,
},
&cli.BoolTFlag{
&cli.BoolFlag{
Name: "log-color",
Usage: "Enable colored logging",
EnvVar: "GRAPH_LOG_COLOR",
EnvVars: []string{"GRAPH_LOG_COLOR"},
Destination: &cfg.Log.Color,
},
}
Expand All @@ -44,7 +44,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9124",
Usage: "Address to debug endpoint",
EnvVar: "GRAPH_DEBUG_ADDR",
EnvVars: []string{"GRAPH_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
}
Expand All @@ -56,144 +56,144 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
&cli.BoolFlag{
Name: "tracing-enabled",
Usage: "Enable sending traces",
EnvVar: "GRAPH_TRACING_ENABLED",
EnvVars: []string{"GRAPH_TRACING_ENABLED"},
Destination: &cfg.Tracing.Enabled,
},
&cli.StringFlag{
Name: "tracing-type",
Value: "jaeger",
Usage: "Tracing backend type",
EnvVar: "GRAPH_TRACING_TYPE",
EnvVars: []string{"GRAPH_TRACING_TYPE"},
Destination: &cfg.Tracing.Type,
},
&cli.StringFlag{
Name: "tracing-endpoint",
Value: "",
Usage: "Endpoint for the agent",
EnvVar: "GRAPH_TRACING_ENDPOINT",
EnvVars: []string{"GRAPH_TRACING_ENDPOINT"},
Destination: &cfg.Tracing.Endpoint,
},
&cli.StringFlag{
Name: "tracing-collector",
Value: "",
Usage: "Endpoint for the collector",
EnvVar: "GRAPH_TRACING_COLLECTOR",
EnvVars: []string{"GRAPH_TRACING_COLLECTOR"},
Destination: &cfg.Tracing.Collector,
},
&cli.StringFlag{
Name: "tracing-service",
Value: "graph",
Usage: "Service name for tracing",
EnvVar: "GRAPH_TRACING_SERVICE",
EnvVars: []string{"GRAPH_TRACING_SERVICE"},
Destination: &cfg.Tracing.Service,
},
&cli.StringFlag{
Name: "debug-addr",
Value: "0.0.0.0:9124",
Usage: "Address to bind debug server",
EnvVar: "GRAPH_DEBUG_ADDR",
EnvVars: []string{"GRAPH_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
&cli.StringFlag{
Name: "debug-token",
Value: "",
Usage: "Token to grant metrics access",
EnvVar: "GRAPH_DEBUG_TOKEN",
EnvVars: []string{"GRAPH_DEBUG_TOKEN"},
Destination: &cfg.Debug.Token,
},
&cli.BoolFlag{
Name: "debug-pprof",
Usage: "Enable pprof debugging",
EnvVar: "GRAPH_DEBUG_PPROF",
EnvVars: []string{"GRAPH_DEBUG_PPROF"},
Destination: &cfg.Debug.Pprof,
},
&cli.BoolFlag{
Name: "debug-zpages",
Usage: "Enable zpages debugging",
EnvVar: "GRAPH_DEBUG_ZPAGES",
EnvVars: []string{"GRAPH_DEBUG_ZPAGES"},
Destination: &cfg.Debug.Zpages,
},
&cli.StringFlag{
Name: "http-addr",
Value: "0.0.0.0:9120",
Usage: "Address to bind http server",
EnvVar: "GRAPH_HTTP_ADDR",
EnvVars: []string{"GRAPH_HTTP_ADDR"},
Destination: &cfg.HTTP.Addr,
},
&cli.StringFlag{
Name: "http-root",
Value: "/",
Usage: "Root path of http server",
EnvVar: "GRAPH_HTTP_ROOT",
EnvVars: []string{"GRAPH_HTTP_ROOT"},
Destination: &cfg.HTTP.Root,
},
&cli.StringFlag{
Name: "http-namespace",
Value: "com.owncloud.web",
Usage: "Set the base namespace for the http service for service discovery",
EnvVar: "GRAPH_HTTP_NAMESPACE",
EnvVars: []string{"GRAPH_HTTP_NAMESPACE"},
Destination: &cfg.HTTP.Namespace,
},
&cli.StringFlag{
Name: "ldap-network",
Value: "tcp",
Usage: "Network protocol to use to connect to the Ldap server",
EnvVar: "GRAPH_LDAP_NETWORK",
EnvVars: []string{"GRAPH_LDAP_NETWORK"},
Destination: &cfg.Ldap.Network,
},
&cli.StringFlag{
Name: "ldap-address",
Value: "localhost:9125",
Usage: "Address to connect to the Ldap server",
EnvVar: "GRAPH_LDAP_ADDRESS",
EnvVars: []string{"GRAPH_LDAP_ADDRESS"},
Destination: &cfg.Ldap.Address,
},
&cli.StringFlag{
Name: "ldap-username",
Value: "cn=admin,dc=example,dc=org",
Usage: "User to bind to the Ldap server",
EnvVar: "GRAPH_LDAP_USERNAME",
EnvVars: []string{"GRAPH_LDAP_USERNAME"},
Destination: &cfg.Ldap.UserName,
},
&cli.StringFlag{
Name: "ldap-password",
Value: "admin",
Usage: "Password to bind to the Ldap server",
EnvVar: "GRAPH_LDAP_PASSWORD",
EnvVars: []string{"GRAPH_LDAP_PASSWORD"},
Destination: &cfg.Ldap.Password,
},
&cli.StringFlag{
Name: "ldap-basedn-users",
Value: "ou=users,dc=example,dc=org",
Usage: "BaseDN to look for users",
EnvVar: "GRAPH_LDAP_BASEDN_USERS",
EnvVars: []string{"GRAPH_LDAP_BASEDN_USERS"},
Destination: &cfg.Ldap.BaseDNUsers,
},
&cli.StringFlag{
Name: "ldap-basedn-groups",
Value: "ou=groups,dc=example,dc=org",
Usage: "BaseDN to look for users",
EnvVar: "GRAPH_LDAP_BASEDN_GROUPS",
EnvVars: []string{"GRAPH_LDAP_BASEDN_GROUPS"},
Destination: &cfg.Ldap.BaseDNGroups,
},
&cli.StringFlag{
Name: "oidc-endpoint",
Value: "",
Usage: "OpenIDConnect endpoint",
EnvVar: "GRAPH_OIDC_ENDPOINT",
EnvVars: []string{"GRAPH_OIDC_ENDPOINT"},
Destination: &cfg.OpenIDConnect.Endpoint,
},
&cli.BoolFlag{
Name: "oidc-insecure",
Usage: "OpenIDConnect endpoint",
EnvVar: "GRAPH_OIDC_INSECURE",
EnvVars: []string{"GRAPH_OIDC_INSECURE"},
Destination: &cfg.OpenIDConnect.Insecure,
},
&cli.StringFlag{
Name: "oidc-realm",
Value: "",
Usage: "OpenIDConnect realm",
EnvVar: "GRAPH_OIDC_REALM",
EnvVars: []string{"GRAPH_OIDC_REALM"},
Destination: &cfg.OpenIDConnect.Realm,
},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/http/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package http
import (
"context"

"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-graph/pkg/config"
"github.com/owncloud/ocis-graph/pkg/metrics"
"github.com/owncloud/ocis-pkg/log"
Expand Down