Adding ocis-graph-explorer to ocis
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
// +build !simple
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-graph-explorer/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis-graph-explorer/pkg/config"
|
||||
"github.com/owncloud/ocis-graph-explorer/pkg/flagset"
|
||||
"github.com/owncloud/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/pkg/register"
|
||||
)
|
||||
|
||||
// GraphExplorerCommand is the entry point for the graph command.
|
||||
func GraphExplorerCommand(cfg *config.Config) cli.Command {
|
||||
return cli.Command{
|
||||
Name: "graph-explorer",
|
||||
Usage: "Start graph explorer",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.ServerWithConfig(cfg.GraphExplorer),
|
||||
Action: func(c *cli.Context) error {
|
||||
scfg := configureGraphExplorer(cfg)
|
||||
|
||||
return cli.HandleAction(
|
||||
command.Server(scfg).Action,
|
||||
c,
|
||||
)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureGraphExplorer(cfg *config.Config) *svcconfig.Config {
|
||||
cfg.GraphExplorer.Log.Level = cfg.Log.Level
|
||||
cfg.GraphExplorer.Log.Pretty = cfg.Log.Pretty
|
||||
cfg.GraphExplorer.Log.Color = cfg.Log.Color
|
||||
cfg.GraphExplorer.Tracing.Enabled = false
|
||||
cfg.GraphExplorer.HTTP.Addr = "localhost:9135"
|
||||
cfg.GraphExplorer.HTTP.Root = "/"
|
||||
|
||||
return cfg.GraphExplorer
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(GraphExplorerCommand)
|
||||
}
|
||||
+17
-14
@@ -2,6 +2,7 @@ package config
|
||||
|
||||
import (
|
||||
graph "github.com/owncloud/ocis-graph/pkg/config"
|
||||
graphExplorer "github.com/owncloud/ocis-graph-explorer/pkg/config"
|
||||
hello "github.com/owncloud/ocis-hello/pkg/config"
|
||||
konnectd "github.com/owncloud/ocis-konnectd/pkg/config"
|
||||
ocs "github.com/owncloud/ocis-ocs/pkg/config"
|
||||
@@ -54,24 +55,26 @@ type Config struct {
|
||||
GRPC GRPC
|
||||
Tracing Tracing
|
||||
|
||||
Graph *graph.Config
|
||||
Hello *hello.Config
|
||||
Konnectd *konnectd.Config
|
||||
OCS *ocs.Config
|
||||
Phoenix *phoenix.Config
|
||||
WebDAV *webdav.Config
|
||||
Reva *reva.Config
|
||||
Graph *graph.Config
|
||||
GraphExplorer *graphExplorer.Config
|
||||
Hello *hello.Config
|
||||
Konnectd *konnectd.Config
|
||||
OCS *ocs.Config
|
||||
Phoenix *phoenix.Config
|
||||
WebDAV *webdav.Config
|
||||
Reva *reva.Config
|
||||
}
|
||||
|
||||
// New initializes a new configuration with or without defaults.
|
||||
func New() *Config {
|
||||
return &Config{
|
||||
Graph: graph.New(),
|
||||
Hello: hello.New(),
|
||||
Konnectd: konnectd.New(),
|
||||
OCS: ocs.New(),
|
||||
Phoenix: phoenix.New(),
|
||||
WebDAV: webdav.New(),
|
||||
Reva: reva.New(),
|
||||
Graph: graph.New(),
|
||||
GraphExplorer: graphExplorer.New(),
|
||||
Hello: hello.New(),
|
||||
Konnectd: konnectd.New(),
|
||||
OCS: ocs.New(),
|
||||
Phoenix: phoenix.New(),
|
||||
WebDAV: webdav.New(),
|
||||
Reva: reva.New(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ var Extensions = []string{
|
||||
"hello",
|
||||
"phoenix",
|
||||
"graph",
|
||||
"graph-explorer",
|
||||
"ocs",
|
||||
"webdav",
|
||||
"reva-frontend",
|
||||
|
||||
Reference in New Issue
Block a user