Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCheckIDMandatory is returned when the API is asked to update the state // of the check but no checkID is provided. ErrCheckIDMandatory = errors.New("a check must inform always a check id when updating its state") // ErrStatusMandatory is returned when the API is asked to update the state // of the check but no status is provided. ErrStatusMandatory = errors.New("a check must inform always a stauts when updating its state") )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API defines the methods of the API that the agent exposes to the outside.
func New ¶
func New(log log.Logger, supdater CheckStateUpdater, astats AgentStats) *API
New returns an API filled with the provided check state updater and the agent stats service.
func (*API) CheckUpdate ¶
func (a *API) CheckUpdate(c CheckState) error
CheckUpdate attends the request sent by a check in order to update its state.
type AgentStats ¶
AgentStats defined the methods needed by the API to gather the information about agent stats that it exposed to the outside world.
type CheckState ¶
type CheckState struct {
ID string
Report *report.Report `json:"report,omitempty"`
Progress *float32 `json:"progress,omitempty"`
Status *string `json:"status,omitempty"`
}
CheckState holds the values related to the state of a check. The values defined here the one written to the check states queue.
type CheckStateUpdater ¶
type CheckStateUpdater interface {
UpdateState(stateupdater.CheckState) error
UploadCheckData(checkID, kind string, startedAt time.Time, content []byte) (string, error)
}
CheckStateUpdater defines the method needed by the API in order to send check updates messages to the corresponding queue.
Click to show internal directories.
Click to hide internal directories.