Documentation
¶
Overview ¶
Package notification //
Package notification //
Package notification //
Package notification //
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicManager ¶
type AtomicManager struct {
// contains filtered or unexported fields
}
AtomicManager adds handlers atomically
func NewAtomicManager ¶
func NewAtomicManager() *AtomicManager
NewAtomicManager creates a new instance of the atomic manager
func (*AtomicManager) AddHandler ¶
func (am *AtomicManager) AddHandler(newHandler func(interface{})) (int, error)
AddHandler adds the given handler
func (*AtomicManager) Send ¶
func (am *AtomicManager) Send(notification interface{})
Send sends the notification to the registered handlers
type Center ¶
type Center interface { AddHandler(Type, func(interface{})) (int, error) Send(Type, interface{}) error }
Center handles all notification listeners. It keeps track of the Manager for each type of notification.
type DecisionNotification ¶
type DecisionNotification struct { Type DecisionNotificationType UserContext entities.UserContext DecisionInfo map[string]interface{} }
DecisionNotification is a notification triggered when a decision is made for either a feature or an experiment
type DecisionNotificationType ¶
type DecisionNotificationType string
DecisionNotificationType is the type of decision notification
const ( // Feature is used when the decision is returned as part of evaluating a feature Feature DecisionNotificationType = "feature" )
type DefaultCenter ¶
type DefaultCenter struct {
// contains filtered or unexported fields
}
DefaultCenter contains all the notification managers
func NewNotificationCenter ¶
func NewNotificationCenter() *DefaultCenter
NewNotificationCenter returns a new notification center
func (*DefaultCenter) AddHandler ¶
func (c *DefaultCenter) AddHandler(notificationType Type, handler func(interface{})) (int, error)
AddHandler adds a handler for the given notification type
func (*DefaultCenter) Send ¶
func (c *DefaultCenter) Send(notificationType Type, notification interface{}) error
Send sends the given notification payload to all listeners of type