Documentation
¶
Overview ¶
Package api defines the wire contract between the edge and the central.
Index ¶
Constants ¶
View Source
const ( PathHealth = "/healthz" PathAssignments = "/v1/assignments" PathResults = "/v1/results" )
Paths of the edge API, served by the central.
View Source
const ( KindTCP = "tcp" KindHTTP = "http" )
Kinds of check.
View Source
const ( MaxResultsPerBatch = 1000 MaxErrorLength = 512 )
Limits shared by both sides.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assignments ¶
type Assignments struct {
Checks []Check `json:"checks"`
}
Assignments is what the central answers to an edge poll.
type Check ¶
type Check struct {
ID string `json:"id"`
Kind string `json:"kind"`
Target string `json:"target"`
IntervalSeconds int `json:"interval_seconds"`
}
Check is one measurement an edge runs on a schedule.
type Result ¶
type Result struct {
CheckID string `json:"check_id"`
At time.Time `json:"at"`
OK bool `json:"ok"`
RTTMillis float64 `json:"rtt_millis"`
Error string `json:"error,omitempty"`
}
Result is the outcome of one run of a check.
type ResultsRequest ¶
type ResultsRequest struct {
Results []Result `json:"results"`
}
ResultsRequest is a batch of results posted by an edge.
func (ResultsRequest) Validate ¶
func (r ResultsRequest) Validate() error
Validate reports why a batch must be refused.
Click to show internal directories.
Click to hide internal directories.