Documentation
¶
Index ¶
- Constants
- func GetAs[T any](r Result) (T, *cd.Error)
- func GetValAs[T any](r Result, key string) (T, bool)
- func MatchValue(pattern, val string) bool
- type Event
- type Hub
- type ID2ActionChanelMap
- type ID2ObserverFuncMap
- type ID2ObserverMap
- type Observer
- type ObserverFunc
- type ObserverList
- type Result
- type SimpleObserver
- type Values
Constants ¶
View Source
const ( Action = "_action_" Add = "add" Del = "del" Mod = "mod" Notify = "notify" )
Variables ¶
This section is empty.
Functions ¶
func MatchValue ¶ added in v1.3.39
Types ¶
type Event ¶
type Event interface {
ID() string
Source() string
Destination() string
Header() Values
Context() context.Context
BindContext(ctx context.Context)
Data() interface{}
SetData(key string, val interface{})
GetData(key string) interface{}
Match(pattern string) bool
}
type Hub ¶
type ID2ActionChanelMap ¶ added in v1.3.40
type ID2ActionChanelMap map[string]actionChannel
type ID2ObserverFuncMap ¶
type ID2ObserverFuncMap map[string]ObserverFunc
type ID2ObserverMap ¶
type ID2ObserverMap map[string]ObserverList
type ObserverFunc ¶
type ObserverList ¶
type ObserverList []Observer
type Result ¶
type SimpleObserver ¶
type SimpleObserver interface {
Observer
Subscribe(eventID string, observerFunc ObserverFunc)
Unsubscribe(eventID string)
}
func NewSimpleObserver ¶
func NewSimpleObserver(id string, hub Hub) SimpleObserver
Click to show internal directories.
Click to hide internal directories.