connection

package
v2.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler handling connection data and shift it to lineChan channel

func NewConnectionsHandler

func NewConnectionsHandler(logger moira.Logger) *Handler

NewConnectionsHandler creates new Handler

func (*Handler) HandleConnection

func (handler *Handler) HandleConnection(connection net.Conn, lineChan chan<- []byte)

HandleConnection convert every line from connection to metric and send it to lineChan channel

func (*Handler) StopHandlingConnections

func (handler *Handler) StopHandlingConnections()

StopHandlingConnections closes all open connections and wait for handling remaining metrics

type MetricsListener

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

MetricsListener is facade for standard net.MetricsListener and accept connection for handling it

func NewListener

func NewListener(port string, logger moira.Logger, metrics *graphite.FilterMetrics) (*MetricsListener, error)

NewListener creates new listener

func (*MetricsListener) Listen

func (listener *MetricsListener) Listen() chan []byte

Listen waits for new data in connection and handles it in ConnectionHandler All handled data sets to lineChan

func (*MetricsListener) Stop

func (listener *MetricsListener) Stop() error

Stop stops listening connection

Jump to

Keyboard shortcuts

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