Documentation
¶
Index ¶
- Constants
- func Dispatch[K comparable, V any](chains []Chain[V], cmd K, data V)
- func Heartbeat(initdead, keepalive float64, f func(*Beat))
- type AsyncEvent
- func (a *AsyncEvent[K, V]) Channel(key func(V) K) chan<- V
- func (a *AsyncEvent[K, V]) Del(name string, cmd K, index int) error
- func (a *AsyncEvent[K, V]) Dispatch(cmd K, data V)
- func (a *AsyncEvent[K, V]) On(name string, cmd K, handles ...Handle[V]) (int, error)
- func (a *AsyncEvent[K, V]) OnEqual(cmd K, handles ...Handle[V]) (int, error)
- func (a *AsyncEvent[K, V]) Register(name string, rule Rule[K, V]) *AsyncEvent[K, V]
- func (a *AsyncEvent[K, V]) Rule(name string) (r Rule[K, V], err error)
- type AsyncEventS
- type Beat
- type Chain
- type Equal
- type Event
- type Handle
- type Regexp
- type Rule
Constants ¶
View Source
const ( EQUAL string = "equal" REGEXP string = "regexp" )
Variables ¶
This section is empty.
Functions ¶
func Dispatch ¶ added in v0.4.0
func Dispatch[K comparable, V any](chains []Chain[V], cmd K, data V)
Types ¶
type AsyncEvent ¶
type AsyncEvent[K comparable, V any] struct { // contains filtered or unexported fields }
func New ¶
func New[K comparable, V any]() AsyncEvent[K, V]
func (*AsyncEvent[K, V]) Channel ¶ added in v0.4.0
func (a *AsyncEvent[K, V]) Channel(key func(V) K) chan<- V
func (*AsyncEvent[K, V]) Del ¶ added in v0.4.0
func (a *AsyncEvent[K, V]) Del(name string, cmd K, index int) error
func (*AsyncEvent[K, V]) Dispatch ¶
func (a *AsyncEvent[K, V]) Dispatch(cmd K, data V)
func (*AsyncEvent[K, V]) On ¶
func (a *AsyncEvent[K, V]) On(name string, cmd K, handles ...Handle[V]) (int, error)
func (*AsyncEvent[K, V]) OnEqual ¶ added in v0.3.0
func (a *AsyncEvent[K, V]) OnEqual(cmd K, handles ...Handle[V]) (int, error)
func (*AsyncEvent[K, V]) Register ¶
func (a *AsyncEvent[K, V]) Register(name string, rule Rule[K, V]) *AsyncEvent[K, V]
type AsyncEventS ¶
type AsyncEventS[V any] struct { AsyncEvent[string, V] // contains filtered or unexported fields }
func Default ¶
func Default[V any]() AsyncEventS[V]
type Equal ¶ added in v0.3.0
type Equal[K comparable, V any] map[K][]Chain[V]
Click to show internal directories.
Click to hide internal directories.