events.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package events // import "github.com/docker/docker/api/types/events"
  2. // Type is used for event-types.
  3. type Type = string
  4. // List of known event types.
  5. const (
  6. BuilderEventType Type = "builder" // BuilderEventType is the event type that the builder generates.
  7. ConfigEventType Type = "config" // ConfigEventType is the event type that configs generate.
  8. ContainerEventType Type = "container" // ContainerEventType is the event type that containers generate.
  9. DaemonEventType Type = "daemon" // DaemonEventType is the event type that daemon generate.
  10. ImageEventType Type = "image" // ImageEventType is the event type that images generate.
  11. NetworkEventType Type = "network" // NetworkEventType is the event type that networks generate.
  12. NodeEventType Type = "node" // NodeEventType is the event type that nodes generate.
  13. PluginEventType Type = "plugin" // PluginEventType is the event type that plugins generate.
  14. SecretEventType Type = "secret" // SecretEventType is the event type that secrets generate.
  15. ServiceEventType Type = "service" // ServiceEventType is the event type that services generate.
  16. VolumeEventType Type = "volume" // VolumeEventType is the event type that volumes generate.
  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 of 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. // Message represents the information an event contains
  28. type Message struct {
  29. // Deprecated information from JSONMessage.
  30. // With data only in container events.
  31. Status string `json:"status,omitempty"` // Deprecated: use Action instead.
  32. ID string `json:"id,omitempty"` // Deprecated: use Actor.ID instead.
  33. From string `json:"from,omitempty"` // Deprecated: use Actor.Attributes["image"] instead.
  34. Type Type
  35. Action string
  36. Actor Actor
  37. // Engine events are local scope. Cluster events are swarm scope.
  38. Scope string `json:"scope,omitempty"`
  39. Time int64 `json:"time,omitempty"`
  40. TimeNano int64 `json:"timeNano,omitempty"`
  41. }