Documentation
¶
Index ¶
- Variables
- func Broadcast(name string, values ...Map) error
- func BroadcastTo(conn, name string, values ...Map) error
- func BroadcastToWithMeta(meta *infra.Meta, conn, name string, values ...Map) error
- func BroadcastWithMeta(meta *infra.Meta, name string, values ...Map) error
- func DurationSetting(setting Map, key string, def time.Duration) time.Duration
- func Int64Setting(setting Map, key string, def int64) int64
- func IntSetting(setting Map, key string, def int) int
- func Publish(name string, values ...Map) error
- func PublishTo(conn, name string, values ...Map) error
- func PublishToWithMeta(meta *infra.Meta, conn, name string, values ...Map) error
- func PublishWithMeta(meta *infra.Meta, name string, values ...Map) error
- func StringSetting(setting Map, key, def string) string
- type Config
- type Configs
- type Connection
- type Context
- func (ctx *Context) Broadcast(name string, values ...Map) error
- func (ctx *Context) BroadcastTo(conn, name string, values ...Map) error
- func (ctx *Context) Denied(res Res)
- func (ctx *Context) Error(res Res)
- func (ctx *Context) Failed(res Res)
- func (ctx *Context) Found()
- func (ctx *Context) Next()
- func (ctx *Context) Publish(name string, values ...Map) error
- func (ctx *Context) PublishTo(conn, name string, values ...Map) error
- func (ctx *Context) Retry(res Res)
- type Declare
- type Driver
- type Event
- type Events
- type Filter
- type Handler
- type Instance
- type Module
- func (m *Module) Close()
- func (m *Module) Config(global Map)
- func (m *Module) Open()
- func (m *Module) Register(name string, value Any)
- func (m *Module) RegisterConfig(name string, cfg Config)
- func (m *Module) RegisterConfigs(configs Configs)
- func (m *Module) RegisterDeclare(name string, cfg Declare)
- func (m *Module) RegisterDriver(name string, driver Driver)
- func (m *Module) RegisterEvent(name string, cfg Event)
- func (m *Module) RegisterEvents(prefix string, events Events)
- func (m *Module) RegisterFilter(name string, cfg Filter)
- func (m *Module) RegisterHandler(name string, cfg Handler)
- func (m *Module) Setup()
- func (m *Module) Start()
- func (m *Module) Stop()
- type PayloadError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BroadcastTo ¶ added in v0.7.0
func BroadcastToWithMeta ¶ added in v0.27.0
func BroadcastWithMeta ¶ added in v0.27.0
func DurationSetting ¶ added in v0.28.0
func Int64Setting ¶ added in v0.28.0
func IntSetting ¶ added in v0.28.0
func PublishToWithMeta ¶ added in v0.27.0
func PublishWithMeta ¶ added in v0.27.0
func StringSetting ¶ added in v0.28.0
Types ¶
type Connection ¶ added in v0.7.0
type Context ¶
type Context struct {
*infra.Meta
Name string
Config *Event
Setting Map
Value Map
Args Map
Locals Map
Body Any
// contains filtered or unexported fields
}
func (*Context) BroadcastTo ¶ added in v0.27.0
type Driver ¶
type Driver interface {
Connect(*Instance) (Connection, error)
}
type Event ¶
type Event struct {
Alias []string `json:"alias"`
Name string `json:"name"`
Desc string `json:"desc"`
Nullable bool `json:"-"`
Args Vars `json:"args"`
Setting Map `json:"setting"`
Action ctxFunc `json:"-"`
Actions []ctxFunc `json:"-"`
Found ctxFunc `json:"-"`
Error ctxFunc `json:"-"`
Failed ctxFunc `json:"-"`
Denied ctxFunc `json:"-"`
Connect string `json:"connect"`
}
func (Event) RegistryComponent ¶ added in v0.7.0
type Events ¶ added in v0.7.0
func (Events) RegistryComponent ¶ added in v0.7.0
type Instance ¶
type Instance struct {
Name string
Config Config
Setting base.Map
// contains filtered or unexported fields
}
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) RegisterConfig ¶ added in v0.7.0
func (*Module) RegisterConfigs ¶ added in v0.7.0
func (*Module) RegisterDeclare ¶ added in v0.7.0
func (*Module) RegisterDriver ¶ added in v0.7.0
func (*Module) RegisterEvent ¶ added in v0.7.0
func (*Module) RegisterEvents ¶ added in v0.7.0
func (*Module) RegisterFilter ¶ added in v0.7.0
func (*Module) RegisterHandler ¶ added in v0.7.0
type PayloadError ¶ added in v0.28.0
type PayloadError struct {
Event string
Result Res
}
func (*PayloadError) Error ¶ added in v0.28.0
func (err *PayloadError) Error() string
func (*PayloadError) Unwrap ¶ added in v0.28.0
func (err *PayloadError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.