connection

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterMetrics

func RegisterMetrics()

RegisterMetrics for collection

Types

type GrpcConn

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

GrpcConn manages grpc connection and buffer

func NewGrpcConn

func NewGrpcConn(address string) (*GrpcConn, error)

NewGrpcConn creates new grpc connection

func (*GrpcConn) AddMessage

func (u *GrpcConn) AddMessage(ctx context.Context, m parser.Metric)

AddMessage add a message to the grpc buffer

func (*GrpcConn) Close

func (u *GrpcConn) Close()

Close ends grpc connection and empties buffer

func (*GrpcConn) SendBuffer

func (u *GrpcConn) SendBuffer(ctx context.Context) error

SendBuffer to grpc connection

type TCPConn

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

TCPConn manages tcp connection and buffer

func NewTCPConn

func NewTCPConn(address string) (*TCPConn, error)

NewTCPConn creates new tcp connection

func (*TCPConn) AddMessage

func (u *TCPConn) AddMessage(m parser.Metric)

AddMessage add a message to the tcp buffer

func (*TCPConn) Close

func (u *TCPConn) Close()

Close ends tcp connection and empties buffer

func (*TCPConn) SendBuffer

func (u *TCPConn) SendBuffer() error

SendBuffer to tcp connection

type UDPConn

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

UDPConn manages udp connection and buffer

func NewUDPConn

func NewUDPConn(address string) (*UDPConn, error)

NewUDPConn creates new udp connection

func (*UDPConn) AddMessage

func (u *UDPConn) AddMessage(m parser.Metric)

AddMessage add a message to the udp buffer

func (*UDPConn) Close

func (u *UDPConn) Close()

Close ends udp connection and empties buffer

func (*UDPConn) SendBuffer

func (u *UDPConn) SendBuffer()

SendBuffer to udp connection

Jump to

Keyboard shortcuts

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