events

package
v25.0.17+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 228 modules, 500 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 events generated by the engine.

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 eventtypes.Action, eventType eventtypes.Type, actor eventtypes.Actor)

Log creates a local scope message and publishes it

func (*Events) PublishMessage

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

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 added in v1.10.0

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

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) *Filter

NewFilter creates a new Filter

func (*Filter) Include added in v1.9.0

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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