net

package
v0.0.0-...-160cdcc Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChunkMessage

func NewChunkMessage(ref [][]byte, listener *Listener, id [8]byte, sid []byte) *chunkMessage

Types

type ConnPoolInterface

type ConnPoolInterface interface {
	// Close will close all connection
	// and all the open channels
	Close()
	// Wait will block till all workers
	// are finished (most times this is
	// when queue is empty/finished)
	Wait()
	// Start will start the workers in
	// the background to catch new
	// package forwards
	Start(workers int)
	// Push will create a non-blocking
	// queue item that can be later check
	Push(data []byte, id []byte) *ConnQueueItem
	// will write the given bytes to
	// the remote and block until we
	// we get some feedback
	Write(data []byte) (int, error)
}

func NewConnPool

func NewConnPool(noClientAuth bool, tries int, address *GraylogHost, ca, crt, pem string, logger *logger.Logger) (ConnPoolInterface, error)

func NewHttpConnPool

func NewHttpConnPool(tries int, host *GraylogHost, logger *logger.Logger) (ConnPoolInterface, error)

func NewHttpsConnPool

func NewHttpsConnPool(tries int, host *GraylogHost, ca, crt, pem string, logger *logger.Logger) (ConnPoolInterface, error)

func NewTcpConnPool

func NewTcpConnPool(tries int, host *GraylogHost, logger *logger.Logger) (ConnPoolInterface, error)

func NewTcpTlsConnPool

func NewTcpTlsConnPool(tries int, address *GraylogHost, ca, crt, pem string, logger *logger.Logger) (ConnPoolInterface, error)

type ConnQueueItem

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

func (ConnQueueItem) Error

func (c ConnQueueItem) Error() []error

Error will return the errors

func (ConnQueueItem) HasError

func (c ConnQueueItem) HasError() bool

HasError will check if we got a error

func (ConnQueueItem) Tries

func (c ConnQueueItem) Tries() int

Tries will return a int representing the amount of tries when successfully was delivered, stopped because of error or reached max retries

func (ConnQueueItem) Wait

func (c ConnQueueItem) Wait()

Wait will block until queue item is processed

type FatalError

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

func (*FatalError) Error

func (f *FatalError) Error() string

type GraylogHost

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

func NewGraylogHost

func NewGraylogHost(host string) *GraylogHost

func (GraylogHost) GetHost

func (g GraylogHost) GetHost() string

func (GraylogHost) GetNetwork

func (g GraylogHost) GetNetwork() string

func (GraylogHost) IsSecure

func (g GraylogHost) IsSecure() bool

func (GraylogHost) String

func (g GraylogHost) String() string

type HttpConnPool

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

func (HttpConnPool) Close

func (p HttpConnPool) Close()

func (*HttpConnPool) Push

func (c *HttpConnPool) Push(d []byte, id []byte) *ConnQueueItem

func (HttpConnPool) Start

func (p HttpConnPool) Start(workers int)

func (HttpConnPool) Wait

func (c HttpConnPool) Wait()

func (*HttpConnPool) Write

func (c *HttpConnPool) Write(d []byte) (int, error)

type HttpsConnPool

type HttpsConnPool struct {
	HttpConnPool
	// contains filtered or unexported fields
}

func (*HttpsConnPool) Push

func (c *HttpsConnPool) Push(d []byte, id []byte) *ConnQueueItem

func (HttpsConnPool) Start

func (p HttpsConnPool) Start(workers int)

func (HttpsConnPool) Wait

func (c HttpsConnPool) Wait()

func (*HttpsConnPool) Write

func (c *HttpsConnPool) Write(d []byte) (int, error)

type Listener

type Listener struct {
	Done chan interface{}
	// contains filtered or unexported fields
}

func NewListener

func NewListener(address string, log *logger.Logger) (*Listener, error)

NewListener is wrapper around the gelf protocol for connectionless protocols, udp, unixgram or ip

func (*Listener) Close

func (u *Listener) Close() error

func (*Listener) Listen

func (u *Listener) Listen()

type TcpConnPool

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

func (*TcpConnPool) Close

func (c *TcpConnPool) Close()

func (*TcpConnPool) Start

func (c *TcpConnPool) Start(workers int)

type TcpTlsConnPool

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

func (*TcpTlsConnPool) Close

func (c *TcpTlsConnPool) Close()

func (*TcpTlsConnPool) Start

func (c *TcpTlsConnPool) Start(workers int)

Jump to

Keyboard shortcuts

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