mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
29 lines
489 B
Go
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)
|
|
},
|
|
}
|