package
7.4.0+incompatible
Repository: https://github.com/magento-mcom/beats.git
Documentation: pkg.go.dev
# Functions
IsMaxReadBufferErr returns true when the error is ErrMaxReadBuffer.
New creates a new tcp server.
NewCloser creates a new Closer.
NewDeadlineReader returns a new DeadlineReader.
NewResetableLimitedReader returns a new ResetableLimitedReader.
SplitFunc allows to create a `bufio.SplitFunc` based on a delimiter provided.
SplitHandlerFactory allows creation of a ConnectionHandler that can do splitting of messages received on a TCP connection.
WithCloser wraps a new closer into a child of an existing closer.
# Constants
Name is the human readable name and identifier.
# Variables
ErrClosed is returned when the Closer is closed.
ErrMaxReadBuffer returns when too many bytes was read on the io.Reader.
# Structs
Closer implements a shutdown strategy when dealing with multiples go-routines, it creates a tree of Closer, when you call `Close()` on a parent the `Close()` method will be called on the current closer and any of the childs it may have and will remove the current node from the parent.
Config exposes the tcp configuration.
DeadlineReader allow read to a io.Reader to timeout, the timeout is refreshed on every read.
ResetableLimitedReader is based on LimitedReader but allow to reset the byte read and return a specific error when we reach the limit.
Server represent a TCP server.
# Interfaces
CloseRef implements a subset of the context.Context interface and it's use to synchronize the shutdown of multiple go-routines.
ConnectionHandler interface provides mechanisms for handling of incoming TCP connections.
# Type aliases
CloserFunc is the function called by the Closer on `Close()`.
HandlerFactory returns a ConnectionHandler func.