Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Main = &gcmd.Command{ Name: "main", Brief: "start http server", Description: "this is the command entry for starting your process", } Http = &gcmd.Command{ Name: "http", Brief: "start http server", Description: "this is the command entry for starting your http server", Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { fmt.Println("start http server") s := g.Server() s.SetIndexFolder(true) s.SetServerRoot("./resource/public/html") s.Group("/", func(group *ghttp.RouterGroup) { router.BindController(group) group.GET("/swagger", func(r *ghttp.Request) { r.Response.Write(swaggerUIPageContent) }) }) enhanceOpenAPIDoc(s) s.Run() return nil }, } Mqtt = &gcmd.Command{ Name: "mqtt", Brief: "start mqtt server", Description: "this is the command entry for starting your mqtt server", Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { fmt.Println("start mqtt server") SetConfigPath("./manifest/config/default_config.yml") NewSimpleCmd() return }, } Plugin = &gcmd.Command{ Name: "plugin", Brief: "start plugin server", Description: "this is the command entry for starting your plugin server", Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { plu := pl.NewServer("unix", "E:\\src\\iotfast\\plugin\\examples\\client") plu.Start() return }, } All = &gcmd.Command{ Name: "all", Brief: "start all server", Description: "this is the command entry for starting all server", Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { fmt.Println("start all server") go Http.Func(ctx, parser) go Plugin.Func(ctx, parser) Mqtt.Func(ctx, parser) return }, } )
View Source
var (
ConfigFile string
)
Functions ¶
func GetListeners ¶
func NewSimpleCmd ¶
func NewSimpleCmd() (err error)
func NewStartCmd ¶
NewStartCmd creates a *cobra.Command object for start command.
func SetConfigPath ¶
func SetConfigPath(path string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.