Documentation ¶
Index ¶
- Constants
- func AddCronjobForExpression(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
- func AddCronjobForInterval(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
- func AddCronjobForSpecifyTime(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
- func AddCronjobOfEveryDay(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
- func AddCronjobOfEveryMonth(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
- func AddCronjobOfEveryWeek(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
- func SetPluginCommand(engine *control.Engine)
- func SetRemindCommand(engine *control.Engine)
- type Command
- type CronJob
- type MenuOptions
Constants ¶
View Source
const ( JobTypeRemind = "remind" // 提醒类任务 JobTypePlugin = "plugin" // 插件类任务 )
View Source
const ( RegexOfPluginEveryMonth = `^设置每月(0?[1-9]|[12][0-9]|3[01])号(([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])的插件任务` RegexOfPluginEveryWeek = `^设置每周(一|二|三|四|五|六|七|日)(([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])的插件任务` RegexOfPluginEveryDay = `^设置每天(([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])的插件任务` RegexOfPluginInterval = `^设置每隔(\d+)(s|秒|m|分|分钟|h|时|d|小时)的插件任务` RegexOfPluginSpecifyTime = `` /* 126-byte string literal not displayed */ RegexOfPluginExpression = `` /* 336-byte string literal not displayed */ RegexOfPluginWorkDay = `^设置工作日(([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])的插件任务$` )
View Source
const ( RegexOfRemindEveryMonth = `^设置每月(0?[1-9]|[12][0-9]|3[01])号(([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])的提醒任务$` RegexOfRemindEveryWeek = `^设置每周(一|二|三|四|五|六|七|日)(([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])的提醒任务$` RegexOfRemindEveryDay = `^设置每天(([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])的提醒任务$` RegexOfRemindInterval = `^设置每隔(\d+)(s|秒|m|分|分钟|h|时|d|小时)的提醒任务$` RegexOfRemindSpecifyTime = `` /* 127-byte string literal not displayed */ RegexOfRemindExpression = `` /* 337-byte string literal not displayed */ RegexOfRemindWorkDay = `^设置工作日(([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])的提醒任务$` )
Variables ¶
This section is empty.
Functions ¶
func AddCronjobForExpression ¶ added in v1.6.2
func AddCronjobForExpression(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
AddCronjobForExpression 添加表达式提醒
func AddCronjobForInterval ¶ added in v1.6.2
func AddCronjobForInterval(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
AddCronjobForInterval 添加间隔提醒
func AddCronjobForSpecifyTime ¶ added in v1.6.2
func AddCronjobForSpecifyTime(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
AddCronjobForSpecifyTime 添加指定时间提醒
func AddCronjobOfEveryDay ¶ added in v1.6.2
func AddCronjobOfEveryDay(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
AddCronjobOfEveryDay 添加每天提醒
func AddCronjobOfEveryMonth ¶ added in v1.6.2
func AddCronjobOfEveryMonth(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
AddCronjobOfEveryMonth 添加每月提醒
func AddCronjobOfEveryWeek ¶ added in v1.6.2
func AddCronjobOfEveryWeek(ctx *robot.Ctx, jobTag string, matched []string, f func()) (*gocron.Job, error)
AddCronjobOfEveryWeek 添加每周提醒
func SetPluginCommand ¶ added in v1.6.2
SetPluginCommand 设置插件类任务指令
func SetRemindCommand ¶ added in v1.6.2
SetRemindCommand 设置提醒类任务指令
Types ¶
type Command ¶ added in v1.0.3
type Command struct {
MenuMode string `gorm:"column:menu_mode;default:'1'"` // 菜单模式,默认模式一
}
type CronJob ¶
type CronJob struct { Id int64 `gorm:"primary_key"` // 任务ID Tag string `gorm:"column:tag"` // 任务标签 Type string `gorm:"column:type"` // 任务类型 Desc string `gorm:"column:desc"` // 任务描述 WxId string `gorm:"column:wx_id"` // 微信ID WxName string `gorm:"column:wx_name"` // 微信昵称 Remind string `gorm:"column:remind"` // 提醒内容 }
type MenuOptions ¶
type MenuOptions struct { WxId string `json:"wxId"` Menus []struct { Name string `json:"name"` Alias string `json:"alias"` Priority uint64 `json:"priority"` Describe string `json:"describe"` DefStatus bool `json:"defStatus"` CurStatus bool `json:"curStatus"` } `json:"menus"` }
MenuOptions 菜单配置
Click to show internal directories.
Click to hide internal directories.