relay

package
v0.0.0-...-e8f29ff Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHTTPPingResponse = http.StatusNoContent
	DefaultHTTPTimeout      = 10 * time.Second
	DefaultMaxDelayInterval = 10 * time.Second
	DefaultBatchSizeKB      = 512

	KB = 1024
	MB = 1024 * KB
)

Default HTTP settings and a few constants

Variables

View Source
var ErrBufferFull = errors.New("retry buffer full")

ErrBufferFull error indicates that retry buffer is full

Functions

This section is empty.

Types

type HTTP

type HTTP struct {
	// contains filtered or unexported fields
}

HTTP is a relay for HTTP influxdb writes

func (*HTTP) Name

func (h *HTTP) Name() string

Name is the name of the HTTP relay a default name might be generated if it is not specified in the configuration file

func (*HTTP) Run

func (h *HTTP) Run() error

Run actually launch the HTTP endpoint

func (*HTTP) ServeHTTP

func (h *HTTP) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is the function that handles the different route The response is a JSON object describing the state of the operation

func (*HTTP) Stop

func (h *HTTP) Stop() error

Stop actually stops the HTTP endpoint

type Operation

type Operation func() error

Operation -TODO-

type Relay

type Relay interface {
	Name() string
	Run() error
	Stop() error
}

Relay is an HTTP or UDP endpoint

func NewHTTP

func NewHTTP(cfg config.HTTPConfig, verbose bool, fs config.Filters) (Relay, error)

NewHTTP creates a new HTTP relay This relay will most likely be tied to a RelayService and manage a set of HTTPBackends

func NewUDP

func NewUDP(config config.UDPConfig) (Relay, error)

NewUDP -TODO-

type UDP

type UDP struct {
	// contains filtered or unexported fields
}

UDP is a relay for UDP influxdb writes

func (*UDP) Name

func (u *UDP) Name() string

Name -TODO-

func (*UDP) Run

func (u *UDP) Run() error

Run -TODO-

func (*UDP) Stop

func (u *UDP) Stop() error

Stop -TODO-

Jump to

Keyboard shortcuts

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