Documentation ¶
Index ¶
Constants ¶
const ( // StatusPassing represents a Consul health check status match that is passing. StatusPassing Status = "passing" // StatusWarning represents a Consul check status match that is a warning. StatusWarning = "warning" // StatusFailing represents a Consul check status match that is a failure. StatusFailing = "failing" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct { Node string CheckID string Name string Status string Notes string `json:",omitempty"` Output string `json:",omitempty"` ServiceID string ServiceName string ServiceTags []string `json:",omitempty"` Definition CheckDefinition `json:"-"` CreateIndex uint64 `json:",omitempty"` ModifyIndex uint64 `json:",omitempty"` }
Check the result of a Consul check.
func (*Check) IsCheckId ¶
IsCheckId returns True if the Check CheckID/Name matches the specified check.
func (*Check) IsCheckName ¶
IsCheckName returns True if the Check CheckName matches the specified checkName.
func (*Check) IsServiceId ¶
IsServiceId returns True if the Check ServiceId matches the specified serviceId.
func (*Check) IsServiceName ¶
IsServiceName returns True if the Check ServiceName matches the specified serviceName.
func (*Check) MatchStatus ¶ added in v0.0.2
func (c *Check) MatchStatus(s HealthStatus) (Status, error)
MatchStatus returns a Status that indicates how the Status of a Check matches the specified status.
type CheckDefinition ¶
type CheckDefinition struct { HTTP string Header map[string][]string Method string TLSSkipVerify bool TCP string Interval time.Duration Timeout time.Duration DeregisterCriticalServiceAfter time.Duration }
CheckDefinition represents the configuration of a Consul check.
type HealthStatus ¶
type HealthStatus int
HealthStatus represents the status of a Consul health check.
const ( // HealthPassing represents Consul health check in the Passing state. HealthPassing HealthStatus = iota // HealthWarning represents Consul health check in the Warning state HealthWarning // HealthMaintenance represents Consul health check in the Maintenance state. HealthMaintenance // HealthCritical represents Consul health check in the Critical state HealthCritical )
func ParseHealthStatus ¶
func ParseHealthStatus(s string) (HealthStatus, bool)
ParseHealthStatus parses a string into a HealthStatus
func (HealthStatus) String ¶
func (s HealthStatus) String() string
type Result ¶
type Result struct { Status ResultStatus Detail string `json:",omitempty"` Counts map[Status]int `json:",omitempty"` Checks map[string]*Check `json:",omitempty"` }
Result represents the result of a Consulate call.
type ResultStatus ¶
type ResultStatus string
ResultStatus represents the status of a Consulate call.
const ( // Ok represents a successful call to Consulate. Ok ResultStatus = "Ok" // Warning represents a warning call to Consulate. Warning ResultStatus = "Warning" // Failed represents a failed call to Consulate. Failed ResultStatus = "Failed" // NoChecks represents verify check call to Consulate which had no checks to verify. NoChecks ResultStatus = "No Checks" )