events

package
v0.0.0-...-89e0d77 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrListenerAlreadyExists = errors.New("Listener already exists")

	ErrListenerDoesNotExists = errors.New("Listener does not exists")

	ErrNoListeners = errors.New("No listeners")

	// EOFEvent is sent when the event listener receives an EOF error.
	EOFEvent = &APIEvent{
		Type:   "EOF",
		Status: "EOF",
	}
)

Functions

This section is empty.

Types

type APIActor

type APIActor struct {
	ID         string            `json:"id,omitempty"`
	Attributes map[string]string `json:"attributes,omitempty"`
}

APIActor represents an actor that accomplishes something for an event

type APIEvent

type APIEvent struct {
	// New API Fields in 1.22
	Action string   `json:"action,omitempty"`
	Type   string   `json:"type,omitempty"`
	Actor  APIActor `json:"actor,omitempty"`

	// Old API fields for < 1.22
	Status string `json:"status,omitempty"`
	ID     string `json:"id,omitempty"`
	From   string `json:"from,omitempty"`

	// Fields in both
	Time     int64 `json:"time,omitempty"`
	TimeNano int64 `json:"timeNano,omitempty"`
}

type Events

type Events interface {
	AddEventListener(listener chan<- events.Message) error
	RemoveEventListener(listener chan<- events.Message) error
}

func New

func New(messageC <-chan events.Message, errC <-chan error) Events

New connects container events from the Docker daemon with an event state

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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