Documentation
¶
Index ¶
Constants ¶
const ( StatusCreated = "CREATED" StatusQueued = "QUEUED" StatusAssigned = "ASSIGNED" StatusRunning = "RUNNING" StatusTimeout = "TIMEOUT" StatusAborted = "ABORTED" StatusPurging = "PURGING" StatusKilled = "KILLED" StatusFailed = "FAILED" StatusFinished = "FINISHED" StatusMalformed = "MALFORMED" StatusInconclusive = "INCONCLUSIVE" )
Variables ¶
var TerminalStatuses = map[string]struct{}{ StatusFailed: {}, StatusFinished: {}, StatusInconclusive: {}, StatusKilled: {}, StatusMalformed: {}, StatusTimeout: {}, }
TerminalStatuses contains all the possible statuses of a check that are terminal.
Functions ¶
This section is empty.
Types ¶
type CheckState ¶
type CheckState struct {
ID string `json:"id" validate:"required"`
Status *string `json:"status,omitempty"`
AgentID *string `json:"agent_id,omitempty"`
Report *string `json:"report,omitempty"`
Raw *string `json:"raw,omitempty"`
Progress *float32 `json:"progress,omitempty"`
}
CheckState defines the all the possible fields of the states sent to the check state queue.
type QueueWriter ¶
QueueWriter defines the queue services used by and updater to send the status updates.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater takes a CheckState an send its to a queue using the defined queue writer.
func New ¶
func New(qw QueueWriter) *Updater
New creates a new updater using the provided queue writer.
func (*Updater) CheckStatusTerminal ¶
CheckStatusTerminal returns true if a check with the given ID has sent so far a state update including a status in a terminal state.
func (*Updater) DeleteCheckStatusTerminal ¶
DeleteCheckStatusTerminal deletes the information about a check that the Updater is storing.
func (*Updater) UpdateState ¶
func (u *Updater) UpdateState(s CheckState) error
UpdateState updates the state of tha check into the underlaying queue.