Documentation
¶
Index ¶
- Constants
- func Configure(cfg Map)
- func Enqueue(name string, values ...Map) error
- func EnqueueTo(conn, name string, datas ...[]byte) error
- func Go()
- func Ready()
- func Register(name string, value Any, overrides ...bool)
- type Config
- type Configs
- type Connect
- type Context
- type Delegate
- type Driver
- type Filter
- type Handler
- type Health
- type Instance
- type Module
- func (this *Module) Config(name string, config Config, override bool)
- func (this *Module) Configs(config Configs, override bool)
- func (this *Module) Configure(global Map)
- func (this *Module) Connect()
- func (module *Module) Driver(name string, driver Driver, override bool)
- func (this *Module) Enqueue(name string, values ...Map) error
- func (this *Module) EnqueueTo(conn, name string, datas ...[]byte) error
- func (module *Module) Filter(name string, config Filter, override bool)
- func (module *Module) Handler(name string, config Handler, override bool)
- func (this *Module) Initialize()
- func (this *Module) Launch()
- func (module *Module) Notice(name string, config Notice, override bool)
- func (module *Module) Queue(name string, config Queue, override bool)
- func (this *Module) Register(name string, value Any, override bool)
- func (this *Module) Terminate()
- type Notice
- type Queue
Constants ¶
View Source
const (
NAME = "QUEUE"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connect ¶
type Connect interface {
Open() error
Health() (Health, error)
Close() error
Register(name string) error
Start() error
Stop() error
Enqueue(name string, data []byte) error
}
Connect 连接
type Context ¶
type Filter ¶
type Filter struct {
Name string `json:"name"`
Text string `json:"text"`
Serve ctxFunc `json:"-"`
Request ctxFunc `json:"-"`
Execute ctxFunc `json:"-"`
Response ctxFunc `json:"-"`
}
Filter 拦截器
type Handler ¶
type Handler struct {
Name string `json:"name"`
Text string `json:"text"`
Found ctxFunc `json:"-"`
Error ctxFunc `json:"-"`
Failed ctxFunc `json:"-"`
Denied ctxFunc `json:"-"`
}
Handler 处理器
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) Initialize ¶
func (this *Module) Initialize()
type Notice ¶
type Notice struct {
Name string `json:"name"`
Text string `json:"text"`
Nullable bool `json:"nullable"`
Args Vars `json:"args"`
}
Notice 通知,表示当前节点会发出的队列预告 比如,支付模块,可能会发布 pay.Finish 之类的一系列的支付完成的队列 在集群模式下,应该会把节点的notice写入集群节点信息下 这样方便,生成分布式的文档
type Queue ¶
type Queue struct {
Name string `json:"name"`
Text string `json:"text"`
Alias []string `json:"alias"`
Nullable bool `json:"-"`
Args Vars `json:"args"`
Setting Map `json:"-"`
Coding bool `json:"-"`
Action ctxFunc `json:"-"`
Actions []ctxFunc `json:"-"`
// 路由单独可定义的处理器
Found ctxFunc `json:"-"`
Error ctxFunc `json:"-"`
Failed ctxFunc `json:"-"`
Denied ctxFunc `json:"-"`
Line int `json:"line"`
Connect string `json:"connect"`
Retry int `json:"retry"`
}
Click to show internal directories.
Click to hide internal directories.