simplify runtime builder

This commit is contained in:
A.Unger
2020-01-10 11:59:19 +01:00
parent 1aefa43f86
commit 813ae5eb63

View File

@@ -14,7 +14,11 @@ import (
"github.com/owncloud/ocis/pkg/tracing"
)
// Simple is the entrypoint for the server command.
var (
SimpleRuntimeServices = []string{"hello", "konnectd", "phoenix"}
)
// Simple is the entrypoint for the server command. It is the `ocis server` subcommand overloaded with a different set of services
func Simple(cfg *config.Config) cli.Command {
return cli.Command{
Name: "server",
@@ -36,25 +40,15 @@ func Simple(cfg *config.Config) cli.Command {
}
runtime := runtime.New(
runtime.Services(
append(
runtime.RuntimeServices,
[]string{
"hello",
"konnectd",
"phoenix",
}...,
),
),
runtime.Logger(logger),
runtime.Services(append(runtime.RuntimeServices, SimpleRuntimeServices...)),
runtime.MicroRuntime(cmd.DefaultCmd.Options().Runtime),
)
// fork uses the micro runtime to fork go-micro services
runtime.Start()
// trap blocks until a kill signal is sent
runtime.Trap()
{
runtime.Start()
runtime.Trap()
}
return nil
},