events

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerCreated       = "Created"
	ContainerFailed        = "Failed"
	ContainerMigrated      = "Migrated"
	ContainerMigratedByDrs = "MigratedByDrs"
	ContainerPoweredOff    = "PoweredOff"
	ContainerPoweredOn     = "PoweredOn"
	ContainerReconfigured  = "Reconfigured"
	ContainerRelocated     = "Relocated"
	ContainerRemoved       = "Removed"
	ContainerResumed       = "Resumed"
	ContainerShutdown      = "Shutdown"
	ContainerStarted       = "Started"
	ContainerStopped       = "Stopped"
	ContainerSuspended     = "Suspended"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEvent

type BaseEvent struct {
	Type        EventType
	Event       string
	ID          string
	Detail      string
	Ref         string
	CreatedTime time.Time
}

func (*BaseEvent) Created

func (be *BaseEvent) Created() time.Time

func (*BaseEvent) EventID

func (be *BaseEvent) EventID() string

func (*BaseEvent) Message

func (be *BaseEvent) Message() string

func (*BaseEvent) Reference

func (be *BaseEvent) Reference() string

func (*BaseEvent) String

func (be *BaseEvent) String() string

return event type / description

type ContainerEvent

type ContainerEvent struct {
	*BaseEvent
}

func (*ContainerEvent) Topic

func (ce *ContainerEvent) Topic() string

type Event

type Event interface {
	EventTopic
	// id of event
	EventID() string
	// event (PowerOn, PowerOff, etc)
	String() string
	// reference evented object
	Reference() string
	// event message
	Message() string

	Created() time.Time
}

type EventTopic

type EventTopic interface {
	Topic() string
}

type EventType

type EventType string

func NewEventType

func NewEventType(kind interface{}) EventType

NewEventType utility function that uses reflection to return the event type

func (EventType) Topic

func (t EventType) Topic() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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