Files
crawlab/backend/cmd/master.go
Marvin Zhang c191afcc6d code cleanup
2021-11-01 12:14:18 +08:00

29 lines
489 B
Go

package cmd
import (
"crawlab/apps"
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(masterCmd)
}
var masterCmd = &cobra.Command{
Use: "master",
Aliases: []string{"M"},
Short: "Start master",
Long: `Start a master instance of Crawlab
which runs api and assign tasks to worker nodes`,
Run: func(cmd *cobra.Command, args []string) {
// options
var opts []apps.MasterOption
// app
master := apps.NewMaster(opts...)
// start
apps.Start(master)
},
}