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: 25 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 BasicAuth

type BasicAuth struct {
	Username string
	Password string
}

BasicAuth basic auth for the configuration

type BasicResponse

type BasicResponse struct {
	Messages []string `json:"messages"`
}

BasicResponse a type for HTTP responses

type BulkPayload

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

BulkPayload the paylaod for bulk requests fo healthchecks

func (*BulkPayload) Validate

func (p *BulkPayload) Validate() error

Validate validates the payload for bulk requests

type Component

type Component struct {
	MemoryStore *memorystore.MemoryStore
	Config      *Configuration
	Logger      *zap.Logger

	Server     *echo.Echo
	Prometheus *prometheus.Prometheus
	// contains filtered or unexported fields
}

Component the http server component

func New

func New(logger *zap.Logger, memstore *memorystore.MemoryStore, promComponent *prometheus.Prometheus, config *Configuration, healthcheck *healthcheck.Component) (*Component, error)

New creates a new HTTP component

func (*Component) Start

func (c *Component) Start() error

Start starts the http server

func (*Component) Stop

func (c *Component) Stop() error

Stop stop the server compoment

type Configuration

type Configuration struct {
	Host                  string
	Port                  uint32
	DisableHealthcheckAPI bool `yaml:"disable-healthcheck-api,omitempty"`
	DisableResultAPI      bool `yaml:"disable-result-api,omitempty"`
	Key                   string
	Cert                  string
	BasicAuth             BasicAuth `yaml:"basic-auth"`
	AllowedCN             []string  `yaml:"allowed-cn"`
	Cacert                string
}

Configuration the HTTP server configuration

func (*Configuration) UnmarshalYAML

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

UnmarshalYAML parses the configuration of the http component from YAML.

Jump to

Keyboard shortcuts

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