checks

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
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

func (c *Check) IsCheckId(checkId string) bool

IsCheckId returns True if the Check CheckID/Name matches the specified check.

func (*Check) IsCheckName

func (c *Check) IsCheckName(checkName string) bool

IsCheckName returns True if the Check CheckName matches the specified checkName.

func (*Check) IsServiceId

func (c *Check) IsServiceId(serviceId string) bool

IsServiceId returns True if the Check ServiceId matches the specified serviceId.

func (*Check) IsServiceName

func (c *Check) IsServiceName(serviceName string) bool

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"
)

type Status added in v0.0.2

type Status string

Status represents the status of a Consul health check match.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL