refactor: updated cmd command funcs
This commit is contained in:
parent
a1a9c6407f
commit
1413312893
6 changed files with 63 additions and 1 deletions
20
cmd/serve.go
Normal file
20
cmd/serve.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"git.towk2.me/towk/configurator/pkg/service"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var serveCmd = &cobra.Command{
|
||||
Use: "serve",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
server := service.New()
|
||||
err := server.Serve()
|
||||
log.Error().Err(err).Msg("server closed")
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(serveCmd)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue