receiver

package
v0.0.0-...-f0721d9 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(Receiver) error

func BufferSize

func BufferSize(size int) Option

BufferSize creates option for New contructor

func Name

func Name(name string) Option

Name creates option for New contructor

func OutChan

func OutChan(ch chan *points.Points) Option

OutChan creates option for New contructor

func OutFunc

func OutFunc(out func(*points.Points)) Option

OutFunc creates option for New contructor

func PickleMaxMessageSize

func PickleMaxMessageSize(size uint32) Option

PickleMaxMessageSize creates option for New contructor

func UDPLogIncomplete

func UDPLogIncomplete(enable bool) Option

UDPLogIncomplete creates option for New contructor

type Receiver

type Receiver interface {
	Stop()
	Name() string
	Stat(helper.StatCallback)
}

func New

func New(dsn string, opts ...Option) (Receiver, error)

New creates udp, tcp, pickle receiver

type TCP

type TCP struct {
	helper.Stoppable
	// contains filtered or unexported fields
}

TCP receive metrics from TCP connections

func (*TCP) Addr

func (rcv *TCP) Addr() net.Addr

Addr returns binded socket address. For bind port 0 in tests

func (*TCP) HandleConnection

func (rcv *TCP) HandleConnection(conn net.Conn)

func (*TCP) Listen

func (rcv *TCP) Listen(addr *net.TCPAddr) error

Listen bind port. Receive messages and send to out channel

func (*TCP) Name

func (rcv *TCP) Name() string

Name returns receiver name (for store internal metrics)

func (*TCP) Stat

func (rcv *TCP) Stat(send helper.StatCallback)

type UDP

type UDP struct {
	helper.Stoppable
	// contains filtered or unexported fields
}

UDP receive metrics from UDP socket

func (*UDP) Addr

func (rcv *UDP) Addr() net.Addr

Addr returns binded socket address. For bind port 0 in tests

func (*UDP) Listen

func (rcv *UDP) Listen(addr *net.UDPAddr) error

Listen bind port. Receive messages and send to out channel

func (*UDP) Name

func (rcv *UDP) Name() string

Name returns receiver name (for store internal metrics)

func (*UDP) Stat

func (rcv *UDP) Stat(send helper.StatCallback)

Jump to

Keyboard shortcuts

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