Documentation ¶
Index ¶
- type Events
- func (e *Events) Evict(l chan interface{})
- func (e *Events) Log(action, id, from string)
- func (e *Events) Subscribe() ([]*jsonmessage.JSONMessage, chan interface{}, func())
- func (e *Events) SubscribeTopic(since, sinceNano int64, ef *Filter) ([]*jsonmessage.JSONMessage, chan interface{})
- func (e *Events) SubscribersCount() int
- type Filter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events is pubsub channel for *jsonmessage.JSONMessage
func (*Events) Log ¶
Log broadcasts event to listeners. Each listener has 100 millisecond for receiving event or it will be skipped.
func (*Events) Subscribe ¶
func (e *Events) Subscribe() ([]*jsonmessage.JSONMessage, chan interface{}, func())
Subscribe adds new listener to events, returns slice of 64 stored last events, a channel in which you can expect new events (in form of interface{}, so you need type assertion), and a function to call to stop the stream of events.
func (*Events) SubscribeTopic ¶
func (e *Events) SubscribeTopic(since, sinceNano int64, ef *Filter) ([]*jsonmessage.JSONMessage, chan interface{})
SubscribeTopic adds new listener to events, returns slice of 64 stored last events, a channel in which you can expect new events (in form of interface{}, so you need type assertion).
func (*Events) SubscribersCount ¶
SubscribersCount returns number of event listeners
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter can filter out docker events from a stream
func (*Filter) Include ¶
func (ef *Filter) Include(ev *jsonmessage.JSONMessage) bool
Include returns true when the event ev is included by the filters