events.go 1.3 KB

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