cron

package module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 6 Imported by: 1

README

corn

chefgo corn module.

Documentation

Index

Constants

View Source
const (
	NAME = "CRON"
)

Variables

This section is empty.

Functions

func Configure

func Configure(cfg Map)

Configure 更新配置

func Go

func Go()

Go 直接开跑 此方法只单独使用模块时用

func Ready

func Ready()

Ready 准备运行 此方法只单独使用模块时用

func Register

func Register(name string, value Any, overrides ...bool)

Register 开放给外

Types

type Config

type Config struct {
	Setting Map
}

type Context

type Context struct {
	chef.Meta

	// 以下几个字段必须独立
	// 要不然,Invoke的时候,会被修改掉
	// 因为invoke是同一个 *Meta 对象
	Name    string
	Config  *Job
	Value   Map
	Args    Map
	Setting Map

	Body Any
	// contains filtered or unexported fields
}

func (*Context) Next

func (ctx *Context) Next()

type Filter

type Filter struct {
	Name   string  `json:"name"`
	Text   string  `json:"text"`
	Action ctxFunc `json:"-"`
}

Filter 拦截器

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func (*Instance) Serve

func (this *Instance) Serve(name string)

type Job

type Job struct {
	Name    string
	Text    string
	Time    string
	Times   []string
	Setting Map  `json:"-"`
	Coding  bool `json:"-"`

	Action  ctxFunc   `json:"-"`
	Actions []ctxFunc `json:"-"`
}

type Module

type Module struct {
	// contains filtered or unexported fields
}

func (*Module) Configure

func (this *Module) Configure(global Map)

func (*Module) Connect

func (this *Module) Connect()

func (*Module) Filter

func (this *Module) Filter(name string, config Filter, override bool)

Filter 注册 拦截器

func (*Module) Initialize

func (this *Module) Initialize()

func (*Module) Job

func (this *Module) Job(name string, config Job, override bool)

func (*Module) Launch

func (this *Module) Launch()

func (*Module) Register

func (this *Module) Register(name string, value Any, override bool)

func (*Module) Terminate

func (this *Module) Terminate()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL