listener

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package listener defines the functions for the publisher of messages to the bus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

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

Listener accepts measurements in InfluxDB Line Protocol format via UDP or HTTP, batches them and then publishes them to a NATS subject.

func StartHTTPListener

func StartHTTPListener(c *config.Config) (*Listener, error)

StartHTTPListener initialises listener configured to accept lines from HTTP request bodies instead of via UDP. It starts the listener and its statistician and never returns.

func StartListener

func StartListener(c *config.Config) (_ *Listener, err error)

StartListener initialises a listener, starts its statistician goroutine and runs it's main loop. It never returns.

The listener reads incoming UDP packets, batches them up and sends them onwards to a NATS subject.

func (*Listener) Stop

func (l *Listener) Stop()

Stop shuts down a running listener. It should be called exactly once for every Listener instance.

Jump to

Keyboard shortcuts

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