listener

package
v0.0.0-...-1d9613f Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2018 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 ConnectionHandler

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

ConnectionHandler creates a worker for each new connection and releases the ones that must be stopped

func NewConnectionHandler

func NewConnectionHandler(pp pipeline.Provider, source *config.LogSource) *ConnectionHandler

NewConnectionHandler returns a new ConnectionHandler

func (*ConnectionHandler) HandleConnection

func (h *ConnectionHandler) HandleConnection(conn net.Conn)

HandleConnection forwards the new connection to connChan

func (*ConnectionHandler) Start

func (h *ConnectionHandler) Start()

Start starts the handler

func (*ConnectionHandler) Stop

func (h *ConnectionHandler) Stop()

Stop stops all the workers in parallel, this call returns only when connChan is flushed and all workers are stopped

type Listener

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

Listener summons different protocol specific listeners based on configuration

func New

func New(sources []*config.LogSource, pp pipeline.Provider) *Listener

New returns an initialized Listener

func (*Listener) Start

func (l *Listener) Start()

Start starts the Listener

func (*Listener) Stop

func (l *Listener) Stop()

Stop stops all the listeners

type TCPListener

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

A TCPListener listens and accepts TCP connections and delegates the work to connHandler

func NewTCPListener

func NewTCPListener(pp pipeline.Provider, source *config.LogSource) (*TCPListener, error)

NewTCPListener returns an initialized TCPListener

func (*TCPListener) Start

func (l *TCPListener) Start()

Start listens to TCP connections on another routine

func (*TCPListener) Stop

func (l *TCPListener) Stop()

Stop prevents the listener to accept new incoming connections it blocks until connHandler is flushed

type UDPListener

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

A UDPListener listens for UDP connections and delegates the work to connHandler

func NewUDPListener

func NewUDPListener(pp pipeline.Provider, source *config.LogSource) (*UDPListener, error)

NewUDPListener returns an initialized UDPListener

func (*UDPListener) Start

func (l *UDPListener) Start()

Start listens to UDP connections on another routine

func (*UDPListener) Stop

func (l *UDPListener) Stop()

Stop closes the UDP connection it blocks until connHandler is flushed

type Worker

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

Worker reads data from a connection

func NewWorker

func NewWorker(source *config.LogSource, conn net.Conn, outputChan chan message.Message) *Worker

NewWorker returns a new Worker

func (*Worker) Start

func (w *Worker) Start()

Start prepares the worker to read and decode data from the connection

func (*Worker) Stop

func (w *Worker) Stop()

Stop stops the worker and wait the decoder to be flushed

Jump to

Keyboard shortcuts

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