http

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Name     string
	Host     string
	Path     string
	Port     uint32
	Protocol healthcheck.Protocol
	Headers  map[string]string    `json:"headers,omitempty"`
	Query    map[string]string    `json:"query,omitempty"`
	Interval healthcheck.Duration `json:"interval"`
	Key      string               `json:"key,omitempty"`
	Cert     string               `json:"cert,omitempty"`
	Cacert   string               `json:"cacert,omitempty"`
	Insecure bool
}

func (*Configuration) UnmarshalYAML

func (configuration *Configuration) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML Parse a configuration from YAML.

type HTTPDiscovery

type HTTPDiscovery struct {
	Logger *zap.Logger

	Healthcheck *healthcheck.Component
	URL         string
	Config      *Configuration
	Client      *http.Client
	// contains filtered or unexported fields
}

HTTPDiscovery the http discovery struct

func New

func New(logger *zap.Logger, config *Configuration, checkComponent *healthcheck.Component, counter *prom.CounterVec, histogram *prom.HistogramVec) (*HTTPDiscovery, error)

New creates a new HTTP Discovery

func (*HTTPDiscovery) Start

func (c *HTTPDiscovery) Start() error

Start starts the HTTP discovery component

func (*HTTPDiscovery) Stop

func (c *HTTPDiscovery) Stop() error

Stop stops the HTTP discovery component

type ResultPayload

type ResultPayload struct {
	CommandChecks []healthcheck.CommandHealthcheckConfiguration `json:"command-checks"`
	DNSChecks     []healthcheck.DNSHealthcheckConfiguration     `json:"dns-checks"`
	TCPChecks     []healthcheck.TCPHealthcheckConfiguration     `json:"tcp-checks"`
	HTTPChecks    []healthcheck.HTTPHealthcheckConfiguration    `json:"http-checks"`
	TLSChecks     []healthcheck.TLSHealthcheckConfiguration     `json:"tls-checks"`
}

Jump to

Keyboard shortcuts

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