Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AllocationResults ¶
type AllocationResults map[structs.CheckID]*structs.CheckQueryResult
AllocationResults is a view of the check_id -> latest result for group and task checks in an allocation.
type Checker ¶
type Checker interface {
Do(context.Context, *QueryContext, *Query) *structs.CheckQueryResult
}
Checker executes a check given an allocation-specific context, and produces a resulting structs.CheckQueryResult
type ClientResults ¶
type ClientResults map[string]AllocationResults
ClientResults is a holistic view of alloc_id -> check_id -> latest result group and task checks across all allocations on a client.
func (ClientResults) Insert ¶
func (cr ClientResults) Insert(allocID string, result *structs.CheckQueryResult)
type Query ¶
type Query struct { Mode structs.CheckMode // readiness or healthiness Type string // tcp or http Timeout time.Duration // connection / request timeout AddressMode string // host, driver, or alloc PortLabel string // label or value Protocol string // http checks only (http or https) Path string // http checks only Method string // http checks only Headers http.Header // http checks only Body string // http checks only }
A Query is derived from a ServiceCheck and contains the minimal amount of information needed to actually execute that check.
func GetCheckQuery ¶
func GetCheckQuery(c *structs.ServiceCheck) *Query
GetCheckQuery extracts the needed info from c to actually execute the check.
type QueryContext ¶
type QueryContext struct { ID structs.CheckID CustomAddress string ServicePortLabel string Networks structs.Networks NetworkStatus structs.NetworkStatus Ports structs.AllocatedPorts Group string Task string Service string Check string }
A QueryContext contains allocation and service parameters necessary for address resolution.
Click to show internal directories.
Click to hide internal directories.