cron

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: MIT Imports: 6 Imported by: 1

README

cron

infra.go cron module.

Documentation

Index

Constants

View Source
const (
	NAME = "CRON"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Setting Map
}

type Context

type Context struct {
	infra.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)

Filter 注册 拦截器

func (*Module) Initialize

func (this *Module) Initialize()

func (*Module) Job

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

func (*Module) Launch

func (this *Module) Launch()

func (*Module) Register

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

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