mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-06 04:49:48 -06:00
simplify runtime builder
This commit is contained in:
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user