Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher interface { Start() Stop() Send(notification ...Notification) Subscribers() []Subscriber Registrar }
Dispatcher forwards a new notification onto subscribers.
func NewDispatcher ¶
NewDispatcher creates and returns a new dispatcher
type History ¶
type History interface { Push(notification Notification) Notifications() []Notification }
History contains the last x notifications pushed out to subscribers.
type Notification ¶
type Notification struct { APIURL string `json:"apiUrl"` ID string `json:"id"` Type string `json:"type"` PublishReference string `json:"publishReference,omitempty"` LastModified string `json:"lastModified,omitempty"` NotificationDate string `json:"notificationDate,omitempty"` }
Notification model
type Registrar ¶
type Registrar interface { Register(subscriber Subscriber) Close(subscriber Subscriber) }
Registrar (aka Registrator :smirk:) is the interface for a component that manages subscriber registration
type Subscriber ¶
type Subscriber interface { NotificationChannel() chan string Address() string Since() time.Time // contains filtered or unexported methods }
Subscriber represents the interface of a generic subscriber to a push stream
func NewMonitorSubscriber ¶
func NewMonitorSubscriber(address string) Subscriber
NewMonitorSubscriber returns a new instance of a Monitor subscriber
func NewStandardSubscriber ¶
func NewStandardSubscriber(address string) Subscriber
NewStandardSubscriber returns a new instance of a standard subscriber
Click to show internal directories.
Click to hide internal directories.