cleanup runtime services

This commit is contained in:
A.Unger
2020-01-09 14:36:36 +01:00
parent e0c2aa76cd
commit b6293d052c
-62
View File
@@ -11,16 +11,12 @@ import (
"github.com/micro/micro/broker"
"github.com/micro/micro/health"
"github.com/micro/micro/monitor"
"github.com/micro/micro/network"
"github.com/micro/micro/plugin/build"
"github.com/micro/micro/proxy"
"github.com/micro/micro/registry"
"github.com/micro/micro/router"
"github.com/micro/micro/runtime"
"github.com/micro/micro/server"
"github.com/micro/micro/service"
"github.com/micro/micro/store"
"github.com/micro/micro/token"
"github.com/micro/micro/tunnel"
"github.com/micro/micro/web"
"github.com/owncloud/ocis-pkg/log"
@@ -31,19 +27,13 @@ var OwncloudNamespace = "com.owncloud."
// RuntimeServices to start as part of the fullstack option
var RuntimeServices = []string{
// "network", // :8085
"runtime", // :8088
"registry", // :8000
"broker", // :8001
"store", // :8002
"tunnel", // :8083
"router", // :8084
"proxy", // :8081
"api", // :8080
"web", // :8082
"monitor", // :????
// "debug", // :????
// "bot", // :????
}
// Extensions are ocis extension services
@@ -106,7 +96,6 @@ func (r *Runtime) Start() {
// the binary calls itself with the micro service as a subcommand as first argument
gorun.WithCommand(os.Args[0], service),
gorun.WithEnv(env),
// and logs to STDOUT. Perhaps this can be overridden to use a log.Logger
gorun.WithOutput(os.Stdout),
}
@@ -119,28 +108,16 @@ func (r *Runtime) Start() {
// AddRuntime adds the micro subcommands to the cli app
func AddRuntime(app *cli.App) {
// load this from disk / env?
setDefaults()
app.Commands = append(app.Commands, api.Commands()...)
app.Commands = append(app.Commands, broker.Commands()...)
app.Commands = append(app.Commands, health.Commands()...)
app.Commands = append(app.Commands, proxy.Commands()...)
app.Commands = append(app.Commands, monitor.Commands()...)
app.Commands = append(app.Commands, router.Commands()...)
app.Commands = append(app.Commands, tunnel.Commands()...)
app.Commands = append(app.Commands, network.Commands()...)
app.Commands = append(app.Commands, registry.Commands()...)
app.Commands = append(app.Commands, runtime.Commands()...)
app.Commands = append(app.Commands, server.Commands()...)
app.Commands = append(app.Commands, service.Commands()...)
app.Commands = append(app.Commands, store.Commands()...)
app.Commands = append(app.Commands, token.Commands()...)
app.Commands = append(app.Commands, build.Commands()...)
app.Commands = append(app.Commands, web.Commands()...)
// app.Commands = append(app.Commands, bot.Commands()...)
// app.Commands = append(app.Commands, new.Commands()...)
// app.Commands = append(app.Commands, debug.Commands()...)
}
// provide a config.Config with default values?
@@ -149,74 +126,35 @@ func setDefaults() {
api.Name = OwncloudNamespace + "api"
api.Namespace = OwncloudNamespace + "api"
api.HeaderPrefix = "X-Micro-Owncloud-"
// api.EnableRPC = false
// api.RPCPath
// api.Address
// api.Handler
// api.Resolver
// api.ProxyPath
// api.APIPath
// broker
broker.Name = OwncloudNamespace + "http.broker"
// broker.Address
// proxy
proxy.Name = OwncloudNamespace + "proxy"
// proxy.Address
// proxy.Protocol
// proxy.Endpoint
// monitor
monitor.Name = OwncloudNamespace + "monitor"
// router
router.Name = OwncloudNamespace + "router"
// router.Address
// router.Network
// router.Topic
// tunnel
tunnel.Name = OwncloudNamespace + "tunnel"
// tunnel.Address
// tunnel.Token
// tunnel.Tunnel
// network
network.Name = OwncloudNamespace + "network"
// network.Address
// network.Advertise
// network.Resolver
// network.Token
// registry
registry.Name = OwncloudNamespace + "registry"
// registry.Address
// registry.SyncTime
// registry.Topic
// runtime
runtime.Name = OwncloudNamespace + "runtime"
// runtime.Address
// server
server.Name = OwncloudNamespace + "server"
// server.Address
// server.Network
// server.Router
// store
store.Name = OwncloudNamespace + "store"
// store.Address
// web
web.Name = OwncloudNamespace + "web"
web.Namespace = OwncloudNamespace + "web"
// web.ACMECA
// web.ACMEChallengeProvider
// web.ACMEProvider
// web.Address
// web.BasePathHeader
// web.DefaultIcon
}