router

package
v0.0.62 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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Drain

type Drain struct {
	Input    chan syslog.Packet
	Info     chan string
	Error    chan error
	Endpoint string
	// contains filtered or unexported fields
}

Drain creates an output to the specified schema and manages back pressure and sends packets down to the ouptut.

func Create

func Create(endpoint string, maxconnections uint32, sticky bool) (*Drain, error)

Create a new drain

func (*Drain) Close

func (drain *Drain) Close() error

Close closes the drain

func (*Drain) Dial

func (drain *Drain) Dial() error

Dial connects to the endpoint via the specified schema

func (*Drain) Errors

func (drain *Drain) Errors() uint32

Errors returns the amount of errors that has occured on the drain

func (*Drain) MaxConnections

func (drain *Drain) MaxConnections() uint32

MaxConnections returns the maximum allowed connections

func (*Drain) OpenConnections

func (drain *Drain) OpenConnections() uint32

OpenConnections returns the open connections

func (*Drain) Pressure

func (drain *Drain) Pressure() float64

Pressure returns a value between 0-1 represent the percent of full buffers

func (*Drain) ResetMetrics

func (drain *Drain) ResetMetrics()

ResetMetrics sets the sent and errors values to zero

func (*Drain) Sent

func (drain *Drain) Sent() uint32

Sent returns the amount of packets sent since inception or the last time ResetMetrics was fired

type Metric

type Metric struct {
	MaxConnections uint32
	Connections    uint32
	Pressure       float64
	Sent           uint32
	Errors         uint32
}

type Router

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

func NewRouter

func NewRouter(datasources []storage.DataSource, stickyPools bool, maxConnections uint32) (*Router, error)

func (*Router) AddInput

func (router *Router) AddInput(in input.Input, id string) error

func (*Router) Close

func (router *Router) Close() error

func (*Router) DeadPackets

func (router *Router) DeadPackets() int

func (*Router) Dial

func (router *Router) Dial() error

func (*Router) Metrics

func (router *Router) Metrics() map[string]Metric

func (*Router) RemoveInput

func (router *Router) RemoveInput(id string) error

func (*Router) ResetMetrics

func (router *Router) ResetMetrics()

Jump to

Keyboard shortcuts

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