github.com/jiasir/docker@v1.3.3-0.20170609024000-252e610103e7/api/types/events/events.go (about)

     1  package events
     2  
     3  const (
     4  	// ContainerEventType is the event type that containers generate
     5  	ContainerEventType = "container"
     6  	// DaemonEventType is the event type that daemon generate
     7  	DaemonEventType = "daemon"
     8  	// ImageEventType is the event type that images generate
     9  	ImageEventType = "image"
    10  	// NetworkEventType is the event type that networks generate
    11  	NetworkEventType = "network"
    12  	// PluginEventType is the event type that plugins generate
    13  	PluginEventType = "plugin"
    14  	// VolumeEventType is the event type that volumes generate
    15  	VolumeEventType = "volume"
    16  	// ServiceEventType is the event type that services generate
    17  	ServiceEventType = "service"
    18  	// NodeEventType is the event type that nodes generate
    19  	NodeEventType = "node"
    20  	// SecretEventType is the event type that secrets generate
    21  	SecretEventType = "secret"
    22  )
    23  
    24  // Actor describes something that generates events,
    25  // like a container, or a network, or a volume.
    26  // It has a defined name and a set or attributes.
    27  // The container attributes are its labels, other actors
    28  // can generate these attributes from other properties.
    29  type Actor struct {
    30  	ID         string
    31  	Attributes map[string]string
    32  }
    33  
    34  // Message represents the information an event contains
    35  type Message struct {
    36  	// Deprecated information from JSONMessage.
    37  	// With data only in container events.
    38  	Status string `json:"status,omitempty"`
    39  	ID     string `json:"id,omitempty"`
    40  	From   string `json:"from,omitempty"`
    41  
    42  	Type   string
    43  	Action string
    44  	Actor  Actor
    45  	// Engine events are local scope. Cluster events are swarm scope.
    46  	Scope string `json:"scope,omitempty"`
    47  
    48  	Time     int64 `json:"time,omitempty"`
    49  	TimeNano int64 `json:"timeNano,omitempty"`
    50  }