mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-06 10:20:26 +02:00
Add plugins required flag (#40)
* add required plugins flag. * update plugins logs. * add plugins subcommand. * move preflight to prerun.
This commit is contained in:
parent
43a649d2c4
commit
1a752e43d2
6 changed files with 197 additions and 85 deletions
15
cmd/serve.go
15
cmd/serve.go
|
@ -24,14 +24,13 @@ func init() {
|
|||
service := serve{}
|
||||
|
||||
command := &cobra.Command{
|
||||
Use: "serve",
|
||||
Short: "serve neko streaming server",
|
||||
Long: `serve neko streaming server`,
|
||||
Run: service.Command,
|
||||
Use: "serve",
|
||||
Short: "serve neko streaming server",
|
||||
Long: `serve neko streaming server`,
|
||||
PreRun: service.PreRun,
|
||||
Run: service.Run,
|
||||
}
|
||||
|
||||
cobra.OnInitialize(service.Preflight)
|
||||
|
||||
if err := service.Init(command); err != nil {
|
||||
log.Panic().Err(err).Msg("unable to initialize configuration")
|
||||
}
|
||||
|
@ -91,7 +90,7 @@ func (c *serve) Init(cmd *cobra.Command) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (c *serve) Preflight() {
|
||||
func (c *serve) PreRun(cmd *cobra.Command, args []string) {
|
||||
c.logger = log.With().Str("service", "neko").Logger()
|
||||
|
||||
c.configs.Desktop.Set()
|
||||
|
@ -198,7 +197,7 @@ func (c *serve) Shutdown() {
|
|||
c.logger.Err(err).Msg("member manager disconnect")
|
||||
}
|
||||
|
||||
func (c *serve) Command(cmd *cobra.Command, args []string) {
|
||||
func (c *serve) Run(cmd *cobra.Command, args []string) {
|
||||
c.logger.Info().Msg("starting neko server")
|
||||
c.Start(cmd)
|
||||
c.logger.Info().Msg("neko ready")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue