Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DefaultEventsOrigin default origin when not specified
DefaultEventsOrigin = "watcher"
)
Variables ¶
View Source
var ( // ErrorNoSuchEntity to specify not found entity ErrorNoSuchEntity = errors.New("no such entity") )
Functions ¶
This section is empty.
Types ¶
type ContainerStatusSource ¶
type ContainerStatusSource struct { ExitCode *int32 `json:"exit_code,omitempty" bson:"exit_code,omitempty"` Signal *int32 `json:"signal,omitempty" bson:"signal,omitempty"` Reason StatusReason `json:"reason,omitempty" bson:"reason,omitempty"` }
ContainerStatusSource holds info about container status
type Event ¶
type Event struct { ID interface{} `json:"id,omitempty" bson:"id,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` Entity string `json:"entity" bson:"entity"` EntityID string `json:"entity_id,omitempty" bson:"entity_id,omitempty"` AccountID uuid.UUID `json:"account_id" bson:"account_id"` ClusterID uuid.UUID `json:"cluster_id" bson:"cluster_id"` NodeID *uuid.UUID `json:"node_id" bson:"node_id"` ApplicationID *uuid.UUID `json:"application_id,omitempty" bson:"application_id,omitempty"` ServiceID *uuid.UUID `json:"service_id,omitempty" bson:"service_id,omitempty"` ContainerID *uuid.UUID `json:"container_id,omitempty" bson:"container_id,omitempty"` Kind string `json:"kind" bson:"kind"` Value interface{} `json:"value,omitempty" bson:"value,omitempty"` Origin string `json:"origin,omitempty" bson:"origin,omitempty"` Source interface{} `json:"source,omitempty" bson:"source,omitempty"` Meta interface{} `json:"meta,omitempty" bson:"meta,omitempty"` }
Event structure
func NewEvent ¶
func NewEvent( timestamp time.Time, identity Identity, entity string, entityID string, kind string, value interface{}, origin string, ) Event
NewEvent creates a new event should be deprecated in favor of NewEventWithSource
func NewEventWithSource ¶
func NewEventWithSource( timestamp time.Time, identity Identity, entity string, entityID string, kind string, value interface{}, origin string, source *ContainerStatusSource, meta *string, ) Event
NewEventWithSource creates a new event
func (*Event) UnmarshalJSON ¶
UnmarshalJSON Default implementation of JSON reads every integer as float.
type Identity ¶
type Identity struct { AccountID uuid.UUID ApplicationID uuid.UUID ServiceID uuid.UUID }
Identity a struct to identify an entity
type Status ¶
type Status int // this should be int64 because json can return only int64
Status entity status
var ( // StatusUnknown fallback status StatusUnknown Status // 0 // StatusRunning running StatusRunning Status = 1 // StatusPending pending StatusPending Status = 2 // StatusWarning warning StatusWarning Status = 3 // StatusError error StatusError Status = 4 // StatusStopping stopping StatusStopping Status = 5 // StatusStopped stopped StatusStopped Status = 6 // StatusTerminating terminating StatusTerminating Status = 7 // StatusTerminated terminated StatusTerminated Status = 8 // StatusPaused paused StatusPaused Status = 9 // StatusCompleted completed (for jobs) StatusCompleted Status = 10 )
type StatusReason ¶
type StatusReason string
StatusReason specifies the reason for container exit
const ( // StatusReasonOOMKilled OOM killed StatusReasonOOMKilled StatusReason = "oom_killed" // StatusReasonCompleted job completed StatusReasonCompleted StatusReason = "completed" // StatusReasonError an error occurred StatusReasonError StatusReason = "error" // StatusReasonCrashLoop container in crashloop StatusReasonCrashLoop StatusReason = "crash_loop" // StatusReasonErrorImagePull cannot pull docker image // also includes image pull back off StatusReasonErrorImagePull StatusReason = "error_image_pull" // StatusReasonCreating creating StatusReasonCreating StatusReason = "creating" // StatusReasonErrorContainerStart error starting container StatusReasonErrorContainerStart StatusReason = "error_container_start" )
Click to show internal directories.
Click to hide internal directories.