events

package
v0.0.0-...-9b4d37b Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Image defines the event/filter type image
	Image = "image"
	// Container defines the event/filter type container
	Container = "container"
	// Type defines the filter type Type
	Type = "type"
	// Create defines the event action create (container)
	Create = "create"
	// Start defines the event action start (container)
	Start = "start"
	// Die defines the event action die (container)
	Die = "die"
	// Detach defines the event action detach (container)
	Detach = "detach"
	// Pull defines the event action image (container)
	Pull = "pull"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Events

type Events interface {
	Subscribe() (<-chan Message, string)
	Unsubscribe(string)
	Publish(string, string, string)
}

Events is the interface to publish and consume events.

func New

func New() Events

New will create return the singleton Events instance.

type Message

type Message struct {
	ID       string
	Type     string
	Action   string
	Time     int64
	TimeNano int64
}

Message is the structure that defines the details of the event.

func (*Message) Match

func (m *Message) Match(typ string, key string, val string) bool

Match will match given event filter conditions.

Jump to

Keyboard shortcuts

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