Skip to content

Commit

Permalink
Merge pull request #6 from owncloud/update-ocis-pkg
Browse files Browse the repository at this point in the history
update ocis-pkg to v2.0.1 and micro/cli to v2
  • Loading branch information
butonic authored Feb 10, 2020
2 parents 2ca5030 + 7140a4d commit 017eeb4
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 352 deletions.
13 changes: 6 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ require (
contrib.go.opencensus.io/exporter/jaeger v0.2.0
contrib.go.opencensus.io/exporter/ocagent v0.6.0
contrib.go.opencensus.io/exporter/zipkin v0.1.1
github.com/UnnoTed/fileb0x v1.1.4 // indirect
github.com/cespare/reflex v0.2.0 // indirect
github.com/go-chi/chi v4.0.2+incompatible
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/micro/cli v0.2.0
github.com/ogier/pflag v0.0.1 // indirect
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d // indirect
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect
github.com/micro/cli/v2 v2.1.1
github.com/oklog/run v1.0.0
github.com/openzipkin/zipkin-go v0.2.2
github.com/owncloud/ocis-pkg v1.2.0
github.com/owncloud/ocis-pkg/v2 v2.0.1
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/viper v1.6.1
go.opencensus.io v0.22.2
golang.org/x/net v0.0.0-20191207000613-e7e4b65ae663
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa
)
374 changes: 72 additions & 302 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/owncloud/ocis-graph-explorer/pkg/config"
"github.com/owncloud/ocis-pkg/log"
"github.com/owncloud/ocis-pkg/v2/log"
)

//go:generate go run github.com/UnnoTed/fileb0x embed.yml
Expand Down
2 changes: 1 addition & 1 deletion pkg/assets/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package assets

import (
"github.com/owncloud/ocis-graph-explorer/pkg/config"
"github.com/owncloud/ocis-pkg/log"
"github.com/owncloud/ocis-pkg/v2/log"
)

// Option defines a single option function.
Expand Down
6 changes: 3 additions & 3 deletions pkg/command/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"fmt"
"net/http"

"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-graph-explorer/pkg/config"
"github.com/owncloud/ocis-graph-explorer/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),
Expand Down
8 changes: 4 additions & 4 deletions pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"os"
"strings"

"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-graph-explorer/pkg/config"
"github.com/owncloud/ocis-graph-explorer/pkg/flagset"
"github.com/owncloud/ocis-graph-explorer/pkg/version"
"github.com/owncloud/ocis-pkg/log"
"github.com/owncloud/ocis-pkg/v2/log"
"github.com/spf13/viper"
)

Expand All @@ -22,7 +22,7 @@ func Execute() error {
Usage: "Serve Graph-Explorer for oCIS",
Compiled: version.Compiled(),

Authors: []cli.Author{
Authors: []*cli.Author{
{
Name: "ownCloud GmbH",
Email: "[email protected]",
Expand Down Expand Up @@ -73,7 +73,7 @@ func Execute() error {
return nil
},

Commands: []cli.Command{
Commands: []*cli.Command{
Server(cfg),
Health(cfg),
},
Expand Down
6 changes: 3 additions & 3 deletions 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 All @@ -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),
Expand Down
46 changes: 24 additions & 22 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-explorer/pkg/config"
)

Expand All @@ -12,19 +12,21 @@ func RootWithConfig(cfg *config.Config) []cli.Flag {
Name: "log-level",
Value: "info",
Usage: "Set logging level",
EnvVar: "GRAPH_EXPLORER_LOG_LEVEL",
EnvVars: []string{"GRAPH_EXPLORER_LOG_LEVEL"},
Destination: &cfg.Log.Level,
},
&cli.BoolTFlag{
&cli.BoolFlag{
Value: true,
Name: "log-pretty",
Usage: "Enable pretty logging",
EnvVar: "GRAPH_EXPLORER_LOG_PRETTY",
EnvVars: []string{"GRAPH_EXPLORER_LOG_PRETTY"},
Destination: &cfg.Log.Pretty,
},
&cli.BoolTFlag{
&cli.BoolFlag{
Value: true,
Name: "log-color",
Usage: "Enable colored logging",
EnvVar: "GRAPH_EXPLORER_LOG_COLOR",
EnvVars: []string{"GRAPH_EXPLORER_LOG_COLOR"},
Destination: &cfg.Log.Color,
},
}
Expand All @@ -37,7 +39,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9136",
Usage: "Address to debug endpoint",
EnvVar: "GRAPH_EXPLORER_DEBUG_ADDR",
EnvVars: []string{"GRAPH_EXPLORER_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
}
Expand All @@ -49,103 +51,103 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
&cli.BoolFlag{
Name: "tracing-enabled",
Usage: "Enable sending traces",
EnvVar: "GRAPH_EXPLORER_TRACING_ENABLED",
EnvVars: []string{"GRAPH_EXPLORER_TRACING_ENABLED"},
Destination: &cfg.Tracing.Enabled,
},
&cli.StringFlag{
Name: "tracing-type",
Value: "jaeger",
Usage: "Tracing backend type",
EnvVar: "GRAPH_EXPLORER_TRACING_TYPE",
EnvVars: []string{"GRAPH_EXPLORER_TRACING_TYPE"},
Destination: &cfg.Tracing.Type,
},
&cli.StringFlag{
Name: "tracing-endpoint",
Value: "",
Usage: "Endpoint for the agent",
EnvVar: "GRAPH_EXPLORER_TRACING_ENDPOINT",
EnvVars: []string{"GRAPH_EXPLORER_TRACING_ENDPOINT"},
Destination: &cfg.Tracing.Endpoint,
},
&cli.StringFlag{
Name: "tracing-collector",
Value: "",
Usage: "Endpoint for the collector",
EnvVar: "GRAPH_EXPLORER_TRACING_COLLECTOR",
EnvVars: []string{"GRAPH_EXPLORER_TRACING_COLLECTOR"},
Destination: &cfg.Tracing.Collector,
},
&cli.StringFlag{
Name: "tracing-service",
Value: "graph-explorer",
Usage: "Service name for tracing",
EnvVar: "GRAPH_EXPLORER_TRACING_SERVICE",
EnvVars: []string{"GRAPH_EXPLORER_TRACING_SERVICE"},
Destination: &cfg.Tracing.Service,
},
&cli.StringFlag{
Name: "debug-addr",
Value: "0.0.0.0:9136",
Usage: "Address to bind debug server",
EnvVar: "GRAPH_EXPLORER_DEBUG_ADDR",
EnvVars: []string{"GRAPH_EXPLORER_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
&cli.StringFlag{
Name: "debug-token",
Value: "",
Usage: "Token to grant metrics access",
EnvVar: "GRAPH_EXPLORER_DEBUG_TOKEN",
EnvVars: []string{"GRAPH_EXPLORER_DEBUG_TOKEN"},
Destination: &cfg.Debug.Token,
},
&cli.BoolFlag{
Name: "debug-pprof",
Usage: "Enable pprof debugging",
EnvVar: "GRAPH_EXPLORER_DEBUG_PPROF",
EnvVars: []string{"GRAPH_EXPLORER_DEBUG_PPROF"},
Destination: &cfg.Debug.Pprof,
},
&cli.BoolFlag{
Name: "debug-zpages",
Usage: "Enable zpages debugging",
EnvVar: "GRAPH_EXPLORER_DEBUG_ZPAGES",
EnvVars: []string{"GRAPH_EXPLORER_DEBUG_ZPAGES"},
Destination: &cfg.Debug.Zpages,
},
&cli.StringFlag{
Name: "http-addr",
Value: "0.0.0.0:9135",
Usage: "Address to bind http server",
EnvVar: "GRAPH_EXPLORER_HTTP_ADDR",
EnvVars: []string{"GRAPH_EXPLORER_HTTP_ADDR"},
Destination: &cfg.HTTP.Addr,
},
&cli.StringFlag{
Name: "http-root",
Value: "/",
Usage: "Root path of http server",
EnvVar: "GRAPH_EXPLORER_HTTP_ROOT",
EnvVars: []string{"GRAPH_EXPLORER_HTTP_ROOT"},
Destination: &cfg.HTTP.Root,
},
&cli.StringFlag{
Name: "http-namespace",
Value: "com.owncloud.web",
Usage: "Set the base namespace for the http namespace",
EnvVar: "GRAPH_EXPLORER_NAMESPACE",
EnvVars: []string{"GRAPH_EXPLORER_NAMESPACE"},
Destination: &cfg.HTTP.Namespace,
},
&cli.StringFlag{
Name: "issuer",
Value: "https://localhost:9130",
Usage: "Set the OpenID Connect Provider",
EnvVar: "GRAPH_EXPLORER_ISSUER",
EnvVars: []string{"GRAPH_EXPLORER_ISSUER"},
Destination: &cfg.GraphExplorer.Issuer,
},
&cli.StringFlag{
Name: "client-id",
Value: "ocis-explorer.js",
Usage: "Set the OpenID Client ID to send to the issuer",
EnvVar: "GRAPH_EXPLORER_CLIENT_ID",
EnvVars: []string{"GRAPH_EXPLORER_CLIENT_ID"},
Destination: &cfg.GraphExplorer.ClientID,
},
&cli.StringFlag{
Name: "graph-url",
Value: "http://localhost:9120",
Usage: "Set the url to the graph api service",
EnvVar: "GRAPH_EXPLORER_GRAPH_URL",
EnvVars: []string{"GRAPH_EXPLORER_GRAPH_URL"},
Destination: &cfg.GraphExplorer.GraphURL,
},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/debug/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"

"github.com/owncloud/ocis-graph-explorer/pkg/config"
"github.com/owncloud/ocis-pkg/log"
"github.com/owncloud/ocis-pkg/v2/log"
)

// Option defines a single option function.
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/owncloud/ocis-graph-explorer/pkg/config"
"github.com/owncloud/ocis-graph-explorer/pkg/version"
"github.com/owncloud/ocis-pkg/service/debug"
"github.com/owncloud/ocis-pkg/v2/service/debug"
)

// Server initializes the debug service and server.
Expand Down
4 changes: 2 additions & 2 deletions pkg/server/http/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package http
import (
"context"

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

// Option defines a single option function.
Expand Down
4 changes: 2 additions & 2 deletions pkg/server/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package http
import (
svc "github.com/owncloud/ocis-graph-explorer/pkg/service/v0"
"github.com/owncloud/ocis-graph-explorer/pkg/version"
"github.com/owncloud/ocis-pkg/middleware"
"github.com/owncloud/ocis-pkg/service/http"
"github.com/owncloud/ocis-pkg/v2/middleware"
"github.com/owncloud/ocis-pkg/v2/service/http"
)

// Server initializes the http service and server.
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/v0/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package svc
import (
"net/http"

"github.com/owncloud/ocis-pkg/log"
"github.com/owncloud/ocis-pkg/v2/log"
)

// NewLogging returns a service that logs messages.
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/v0/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net/http"

"github.com/owncloud/ocis-graph-explorer/pkg/config"
"github.com/owncloud/ocis-pkg/log"
"github.com/owncloud/ocis-pkg/v2/log"
)

// Option defines a single option function.
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/v0/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/go-chi/chi"
"github.com/owncloud/ocis-graph-explorer/pkg/assets"
"github.com/owncloud/ocis-graph-explorer/pkg/config"
"github.com/owncloud/ocis-pkg/log"
"github.com/owncloud/ocis-pkg/v2/log"
)

// Service defines the extension handlers.
Expand Down

0 comments on commit 017eeb4

Please sign in to comment.