Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
func Filter(n *Notification, reducer func(n *Notification) bool) bool
Filter a notification based on given reducer.
func Reduce ¶
func Reduce(req *events.WatchRequest) func(n *Notification) bool
Reduce returns a closure to filter notifications.
func ResourceType ¶
func ResourceType(name string) events.ResourceType
ResourceType returns events.ResourceType for a given key
Types ¶
type Informer ¶
type Informer interface {
Start(ctx context.Context, req *events.WatchRequest, fn func(e *events.Event) error) error
}
Informer is the base informer
type Notification ¶
type Notification struct { ID string `json:"id,omitempty"` ResourceID string `json:"resource_id,omitempty"` ResourceType string `json:"resource_type,omitempty"` EventType string `json:"event_type,omitempty"` Data interface{} `json:"data,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` }
Notification represents an event notification
func (*Notification) Prefix ¶
func (n *Notification) Prefix()
Prefix adds prefix to notification's resource and event type
Click to show internal directories.
Click to hide internal directories.