代码拉取完成,页面将自动刷新
package cmd
import (
"fmt"
"gitee.com/pangxianfei/multiapp/cmd/schedule"
)
type ScheduleCommand struct {
commandHandler func(arg *Arg) error
arg *Arg
when schedule.When
}
func newScheduleCommand(handler func(arg *Arg) error, arg *Arg) *ScheduleCommand {
return &ScheduleCommand{commandHandler: handler, arg: arg}
}
func (sc *ScheduleCommand) Yearly() {
sc.when = schedule.EveryYear
}
func (sc *ScheduleCommand) Monthly() {
sc.when = schedule.EveryMonth
}
func (sc *ScheduleCommand) Daily() {
sc.when = schedule.EveryDay
}
func (sc *ScheduleCommand) Hourly() {
sc.when = schedule.EveryHour
}
func (sc *ScheduleCommand) EveryMinute() {
sc.when = schedule.EveryMinute
}
func (sc *ScheduleCommand) EverySecond() {
sc.when = schedule.EverySecond
}
func (sc *ScheduleCommand) EveryDays(d uint) {
sc.when = fmt.Sprintf(schedule.EveryHoursFormat, d*24)
}
func (sc *ScheduleCommand) EveryHours(h uint) {
sc.when = fmt.Sprintf(schedule.EveryHoursFormat, h)
}
func (sc *ScheduleCommand) EveryMinutes(m uint) {
sc.when = fmt.Sprintf(schedule.EveryMinutesFormat, m)
}
func (sc *ScheduleCommand) EverySeconds(s uint) {
sc.when = fmt.Sprintf(schedule.EverySecondsFormat, s)
}
func (sc *ScheduleCommand) When() schedule.When {
return sc.when
}
func (sc *ScheduleCommand) args() *Arg {
return sc.arg
}
func (sc *ScheduleCommand) handler() func(arg *Arg) error {
return sc.commandHandler
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。