events

package
v1.9.1-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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 New

func New() *Events

New returns new *Events instance

func (*Events) Evict

func (e *Events) Evict(l chan interface{})

Evict evicts listener from pubsub

func (*Events) Log

func (e *Events) Log(action, id, from string)

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{})

Subscribe adds new listener to events, returns slice of 64 stored last events channel in which you can expect new events in form of interface{}, so you need type assertion.

func (*Events) SubscribersCount

func (e *Events) SubscribersCount() int

SubscribersCount returns number of event listeners

type Filter added in v1.9.0

type Filter struct {
	// contains filtered or unexported fields
}

Filter can filter out docker events from a stream

func NewFilter added in v1.9.0

func NewFilter(filter filters.Args, getLabels func(id string) map[string]string) *Filter

NewFilter creates a new Filter

func (*Filter) Include added in v1.9.0

func (ef *Filter) Include(ev *jsonmessage.JSONMessage) bool

Include returns true when the event ev is included by the filters

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL