github.com/zhuohuang-hust/src-cbuild@v0.0.0-20230105071821-c7aab3e7c840/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  )
    17  
    18  // Actor describes something that generates events,
    19  // like a container, or a network, or a volume.
    20  // It has a defined name and a set or attributes.
    21  // The container attributes are its labels, other actors
    22  // can generate these attributes from other properties.
    23  type Actor struct {
    24  	ID         string
    25  	Attributes map[string]string
    26  }
    27  
    28  // Message represents the information an event contains
    29  type Message struct {
    30  	// Deprecated information from JSONMessage.
    31  	// With data only in container events.
    32  	Status string `json:"status,omitempty"`
    33  	ID     string `json:"id,omitempty"`
    34  	From   string `json:"from,omitempty"`
    35  
    36  	Type   string
    37  	Action string
    38  	Actor  Actor
    39  
    40  	Time     int64 `json:"time,omitempty"`
    41  	TimeNano int64 `json:"timeNano,omitempty"`
    42  }