Documentation
¶
Index ¶
- Constants
- Variables
- func DeferredPublish(name string, value Map, delay time.Duration) error
- func DeferredPublishTo(conn, name string, value Map, delay time.Duration) error
- func Publish(name string, values ...Map) error
- func PublishTo(conn, name string, values ...Map) error
- type Config
- type Configs
- type Connect
- type Context
- type Declare
- type Delay
- type Driver
- type Filter
- type Handler
- type Health
- type Info
- type Instance
- type Module
- func (this *Module) Config(name string, config Config)
- func (this *Module) Configs(config Configs)
- func (this *Module) Configure(global Map)
- func (this *Module) Connect()
- func (module *Module) Declare(name string, config Declare)
- func (this *Module) DeferredPublish(name string, value Map, delay time.Duration) error
- func (this *Module) DeferredPublishTo(conn, name string, value Map, delay time.Duration) error
- func (module *Module) Driver(name string, driver Driver)
- func (module *Module) Filter(name string, config Filter)
- func (module *Module) Handler(name string, config Handler)
- func (this *Module) Initialize()
- func (this *Module) Launch()
- func (this *Module) Publish(name string, values ...Map) error
- func (this *Module) PublishTo(conn, name string, values ...Map) error
- func (module *Module) Queue(name string, config Queue)
- func (this *Module) Register(name string, value Any)
- func (this *Module) Terminate()
- type Queue
- type Request
- type Response
- type Retry
Constants ¶
View Source
const (
NAME = "QUEUE"
)
Variables ¶
View Source
var ( ErrInvalidConnection = errors.New("Invalid queue connection.") ErrInvalidMsg = errors.New("Invalid queue msg.") ErrInvalidDeclare = errors.New("Invalid queue declare.") ErrInvalidWeight = errors.New("Invalid queue connection weight.") ErrQueueUnfinished = errors.New("queue unfinished.") )
Functions ¶
func DeferredPublishTo ¶
Types ¶
type Connect ¶
type Connect interface { Open() error Health() (Health, error) Close() error Register(string) error Start() error Stop() error Publish(name string, data []byte) error DeferredPublish(name string, data []byte, delay time.Duration) error }
Connect 连接
type Context ¶
type Declare ¶
type Declare struct { Alias []string `json:"alias"` Name string `json:"name"` Text string `json:"text"` Nullable bool `json:"-"` Args Vars `json:"args"` }
Declare 声明,表示当前节点会发出的队列声明
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 Instance ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) DeferredPublish ¶
func (*Module) DeferredPublishTo ¶
func (*Module) Initialize ¶
func (this *Module) Initialize()
type Queue ¶
type Queue struct { Alias []string `json:"alias"` Name string `json:"name"` Text string `json:"text"` 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:"-"` Connect string `json:"connect"` //Option Thread int `json:"thread"` Retry []time.Duration `json:"delay"` }
Click to show internal directories.
Click to hide internal directories.