2019-12-17 14:32:58 +01:00
|
|
|
package runtime
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/micro/cli"
|
|
|
|
|
"github.com/micro/go-micro/config/cmd"
|
|
|
|
|
"github.com/owncloud/ocis-pkg/log"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Command adds micro runtime commands to the cli app
|
|
|
|
|
func Command(app *cli.App) cli.Command {
|
|
|
|
|
command := cli.Command{
|
2019-12-17 14:34:41 +01:00
|
|
|
Name: "micro",
|
|
|
|
|
Description: "starts the go-micro runtime services",
|
|
|
|
|
Category: "Micro",
|
2019-12-17 14:32:58 +01:00
|
|
|
Action: func(c *cli.Context) error {
|
2019-12-17 15:20:56 +01:00
|
|
|
runtime := New(
|
|
|
|
|
Services(RuntimeServices),
|
|
|
|
|
Logger(log.NewLogger()),
|
|
|
|
|
MicroRuntime(cmd.DefaultCmd.Options().Runtime),
|
|
|
|
|
)
|
2019-12-17 14:32:58 +01:00
|
|
|
|
|
|
|
|
{
|
|
|
|
|
runtime.Start()
|
|
|
|
|
runtime.Trap()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
return command
|
|
|
|
|
}
|