Documentation ¶
Index ¶
- Constants
- Variables
- type Bundle
- type Check
- type Defaults
- type Protocol
- func (p *Protocol) FromString(value string) error
- func (p Protocol) MarshalJSON() ([]byte, error)
- func (p Protocol) MarshalText() (text []byte, err error)
- func (p Protocol) MarshalYAML() (any, error)
- func (p Protocol) String() string
- func (p *Protocol) UnmarshalJSON(data []byte) (err error)
- func (p *Protocol) UnmarshalText(text []byte) error
- func (p *Protocol) UnmarshalYAML(node *yaml.Node) error
- type Result
- type Timeout
- func (t Timeout) MarshalJSON() ([]byte, error)
- func (t Timeout) MarshalText() (text []byte, err error)
- func (t Timeout) MarshalYAML() (any, error)
- func (t Timeout) String() string
- func (t *Timeout) UnmarshalJSON(data []byte) error
- func (t *Timeout) UnmarshalText(text []byte) error
- func (t *Timeout) UnmarshalYAML(node *yaml.Node) (err error)
- type TrackedBundle
- func (g *TrackedBundle) Checks() []TrackedCheck
- func (g *TrackedBundle) ChecksAccessed() bool
- func (g *TrackedBundle) Concurrency() int
- func (g *TrackedBundle) ConcurrencyAccessed() bool
- func (g *TrackedBundle) Description() string
- func (g *TrackedBundle) DescriptionAccessed() bool
- func (g *TrackedBundle) ID() string
- func (g *TrackedBundle) IDAccessed() bool
- func (g *TrackedBundle) Retries() int
- func (g *TrackedBundle) RetriesAccessed() bool
- func (g *TrackedBundle) Timeout() Timeout
- func (g *TrackedBundle) TimeoutAccessed() bool
- func (g *TrackedBundle) Wait() Timeout
- func (g *TrackedBundle) WaitAccessed() bool
- type TrackedCheck
- func (g *TrackedCheck) Address() string
- func (g *TrackedCheck) AddressAccessed() bool
- func (g *TrackedCheck) Description() string
- func (g *TrackedCheck) DescriptionAccessed() bool
- func (g *TrackedCheck) Protocol() Protocol
- func (g *TrackedCheck) ProtocolAccessed() bool
- func (g *TrackedCheck) Result() Result
- func (g *TrackedCheck) ResultAccessed() bool
- func (g *TrackedCheck) Retries() int
- func (g *TrackedCheck) RetriesAccessed() bool
- func (g *TrackedCheck) Timeout() Timeout
- func (g *TrackedCheck) TimeoutAccessed() bool
- func (g *TrackedCheck) Wait() Timeout
- func (g *TrackedCheck) WaitAccessed() bool
Constants ¶
Variables ¶
var MockBundles = []TrackedBundle{ { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, }
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
type Bundle struct { ID string `json:"id,omitempty" yaml:"id,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Timeout Timeout `json:"timeout,omitempty" yaml:"timeout,omitempty"` Retries int `json:"retries,omitempty" yaml:"retries,omitempty"` Wait Timeout `json:"wait,omitempty" yaml:"wait,omitempty"` Concurrency int `json:"concurrency,omitempty" yaml:"concurrency,omitempty"` Checks []Check `json:"checks,omitempty" yaml:"checks,omitempty"` }
Bundle represents a consistent set of checks, with some package-level defaults.
func New ¶
New fetches the bundle data from the given path, parses it and returns a Bundle object with all checks ready to be run.
func (*Bundle) Check ¶
func (b *Bundle) Check()
Check creates a goroutine pool, enqueues all the Checks to the workers in the pool and then waits for the Checks to come back with the actual result.
type Check ¶
type Check struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Timeout Timeout `json:"timeout,omitempty" yaml:"timeout,omitempty"` Retries int `json:"retries,omitempty" yaml:"retries,omitempty"` Wait Timeout `json:"wait,omitempty" yaml:"wait,omitempty"` Address string `json:"address,omitempty" yaml:"address,omitempty"` Protocol Protocol `json:"protocol" yaml:"protocol"` Result Result `json:"result" yaml:"result"` // contains filtered or unexported fields }
Check represents a single check to perform.
type Defaults ¶
type Defaults struct { Timeout *Timeout `yaml:"timeout"` Retries *int `yaml:"retries"` Wait *Timeout `yaml:"wait"` Concurrency *int `yaml:"concurrency"` Ping *struct { Count *int `yaml:"count"` Interval *Timeout `yaml:"interval"` Size *int `yaml:"size"` } `yaml:"ping"` }
var Default *Defaults
type Protocol ¶
type Protocol uint8
Protocol represents the supported protocols.
func (*Protocol) FromString ¶
FromString returns the Protocol value corresponding to the given string representation.
func (Protocol) MarshalJSON ¶
MarshalJSON marshals the Protocol struct to JSON.
func (Protocol) MarshalText ¶
MarshalText marshals the Timeout struct to text.
func (Protocol) MarshalYAML ¶
MarshalYAML marshals the Timeout struct to YAML.
func (*Protocol) UnmarshalJSON ¶
UnmarshalJSON marshals the Timeout struct from JSON.
func (*Protocol) UnmarshalText ¶
UnmarshalText marshals the Timeout struct from text.
func (*Protocol) UnmarshalYAML ¶
UnmarshalYAML marshals the Timeout struct from YAML.
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result represents the result of a check.
func (Result) MarshalJSON ¶
MarshalJSON produces the JSON value for the Result.
func (Result) MarshalYAML ¶
MarshalYAML returns the YAML value for the Result.
type Timeout ¶
Timeout wraps the native time.Duration time, adding JSON, YAML and TOML marshalling/unmarshalling capabilities.
func (Timeout) MarshalJSON ¶
MarshalJSON marshals the Timeout struct to JSON.
func (Timeout) MarshalText ¶
MarshalText marshals the Timeout struct to text.
func (Timeout) MarshalYAML ¶
MarshalYAML marshals the Timeout struct to YAML.
func (*Timeout) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Timeout struct from JSON.
func (*Timeout) UnmarshalText ¶
UnmarshalText unmarshals the Timeout struct from text.
func (*Timeout) UnmarshalYAML ¶
UnmarshalYAML unmarshals the Timeout struct from YAML.
type TrackedBundle ¶
type TrackedBundle struct {
// contains filtered or unexported fields
}
func (*TrackedBundle) Checks ¶
func (g *TrackedBundle) Checks() []TrackedCheck
func (*TrackedBundle) ChecksAccessed ¶
func (g *TrackedBundle) ChecksAccessed() bool
func (*TrackedBundle) Concurrency ¶
func (g *TrackedBundle) Concurrency() int
func (*TrackedBundle) ConcurrencyAccessed ¶
func (g *TrackedBundle) ConcurrencyAccessed() bool
func (*TrackedBundle) Description ¶
func (g *TrackedBundle) Description() string
func (*TrackedBundle) DescriptionAccessed ¶
func (g *TrackedBundle) DescriptionAccessed() bool
func (*TrackedBundle) ID ¶
func (g *TrackedBundle) ID() string
func (*TrackedBundle) IDAccessed ¶
func (g *TrackedBundle) IDAccessed() bool
func (*TrackedBundle) Retries ¶
func (g *TrackedBundle) Retries() int
func (*TrackedBundle) RetriesAccessed ¶
func (g *TrackedBundle) RetriesAccessed() bool
func (*TrackedBundle) Timeout ¶
func (g *TrackedBundle) Timeout() Timeout
func (*TrackedBundle) TimeoutAccessed ¶
func (g *TrackedBundle) TimeoutAccessed() bool
func (*TrackedBundle) Wait ¶
func (g *TrackedBundle) Wait() Timeout
func (*TrackedBundle) WaitAccessed ¶
func (g *TrackedBundle) WaitAccessed() bool
type TrackedCheck ¶
type TrackedCheck struct {
// contains filtered or unexported fields
}
func (*TrackedCheck) Address ¶
func (g *TrackedCheck) Address() string
func (*TrackedCheck) AddressAccessed ¶
func (g *TrackedCheck) AddressAccessed() bool
func (*TrackedCheck) Description ¶
func (g *TrackedCheck) Description() string
func (*TrackedCheck) DescriptionAccessed ¶
func (g *TrackedCheck) DescriptionAccessed() bool
func (*TrackedCheck) Protocol ¶
func (g *TrackedCheck) Protocol() Protocol
func (*TrackedCheck) ProtocolAccessed ¶
func (g *TrackedCheck) ProtocolAccessed() bool
func (*TrackedCheck) Result ¶
func (g *TrackedCheck) Result() Result
func (*TrackedCheck) ResultAccessed ¶
func (g *TrackedCheck) ResultAccessed() bool
func (*TrackedCheck) Retries ¶
func (g *TrackedCheck) Retries() int
func (*TrackedCheck) RetriesAccessed ¶
func (g *TrackedCheck) RetriesAccessed() bool
func (*TrackedCheck) Timeout ¶
func (g *TrackedCheck) Timeout() Timeout
func (*TrackedCheck) TimeoutAccessed ¶
func (g *TrackedCheck) TimeoutAccessed() bool
func (*TrackedCheck) Wait ¶
func (g *TrackedCheck) Wait() Timeout
func (*TrackedCheck) WaitAccessed ¶
func (g *TrackedCheck) WaitAccessed() bool