rename default services

This commit is contained in:
A.Unger
2020-02-17 14:43:56 +01:00
parent e0cfee48f4
commit 4a9fe6ec5f
4 changed files with 52 additions and 54 deletions

View File

@@ -76,6 +76,7 @@ func Execute() error {
},
}
// Load commands from the registry
for _, fn := range register.Commands {
app.Commands = append(
app.Commands,
@@ -83,11 +84,7 @@ func Execute() error {
)
}
runtime.AddRuntime(app)
app.Commands = append(
app.Commands,
runtime.Command(app),
)
runtime.AddMicroPlatform(app)
cli.HelpFlag = &cli.BoolFlag{
Name: "help,h",
@@ -102,7 +99,7 @@ func Execute() error {
return app.Run(os.Args)
}
// NewLogger initializes a service-specific logger instance.
// NewLogger initializes a service-specific logger instance
func NewLogger(cfg *config.Config) log.Logger {
return log.NewLogger(
log.Name("ocis"),

View File

@@ -36,15 +36,12 @@ func Server(cfg *config.Config) *cli.Command {
}
runtime := runtime.New(
runtime.Services(append(runtime.RuntimeServices, runtime.Extensions...)),
runtime.Services(append(runtime.MicroServices, runtime.Extensions...)),
runtime.Logger(logger),
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()
return nil