context

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context
	Name       string                 // 任务名
	Spec       string                 // 任务cron表达式
	Chain      []HandleFunc           // 中间件调用链
	ChainIndex int                    // 执行到chain的哪一环
	KeyValues  map[string]interface{} // 存储KV
	Params     []string               // 获取参数
}

func (*Context) Get

func (ctx *Context) Get(key string) (value interface{}, exist bool)

func (*Context) Next

func (ctx *Context) Next()

执行下一个中间件

func (*Context) Set

func (ctx *Context) Set(key string, value interface{})

func (*Context) Value

func (ctx *Context) Value(key interface{}) (value interface{})

复写context.Context的Value方法, 提供键值能力

type HandleFunc

type HandleFunc func(*Context) // Cron处理函数

Jump to

Keyboard shortcuts

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