Skip to content

command

Tinson Ho edited this page Jul 24, 2019 · 3 revisions

简介

因为有存在这种场景,开发人员需要手动触发执行业务逻辑代码,所以提供了脚本模式的支持。

目录

app/console/commands

注册脚本

func RegisterCommand(c *command.Command) {
	c.AddFunc("test", test)
}

func test() {
	fmt.Println("run test command")
	return
}

执行脚本

执行命名为test的脚本任务

build/bin/snow -a command -m test
Clone this wiki locally