docker: github.com/docker/docker/daemon/events Index | Files | Directories

package events

import "github.com/docker/docker/daemon/events"

Index

Package Files

events.go filter.go metrics.go

type Events Uses

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

Events is pubsub channel for events generated by the engine.

func New Uses

func New() *Events

New returns new *Events instance

func (*Events) Evict Uses

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

Evict evicts listener from pubsub

func (*Events) Log Uses

func (e *Events) Log(action, eventType string, actor eventtypes.Actor)

Log creates a local scope message and publishes it

func (*Events) PublishMessage Uses

func (e *Events) PublishMessage(jm eventtypes.Message)

PublishMessage broadcasts event to listeners. Each listener has 100 milliseconds to receive the event or it will be skipped.

func (*Events) Subscribe Uses

func (e *Events) Subscribe() ([]eventtypes.Message, chan interface{}, func())

Subscribe adds new listener to events, returns slice of 256 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 Uses

func (e *Events) SubscribeTopic(since, until time.Time, ef *Filter) ([]eventtypes.Message, chan interface{})

SubscribeTopic adds new listener to events, returns slice of 256 stored last events, a channel in which you can expect new events (in form of interface{}, so you need type assertion).

func (*Events) SubscribersCount Uses

func (e *Events) SubscribersCount() int

SubscribersCount returns number of event listeners

type Filter Uses

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

Filter can filter out docker events from a stream

func NewFilter Uses

func NewFilter(filter filters.Args) *Filter

NewFilter creates a new Filter

func (*Filter) Include Uses

func (ef *Filter) Include(ev events.Message) bool

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

Directories

PathSynopsis
testutils

Package events imports 7 packages (graph) and is imported by 701 packages. Updated 2018-02-14. Refresh now. Tools for package owners.