Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnectionManager ¶
type ConnectionManager struct {
// contains filtered or unexported fields
}
A ConnectionManager manages connections
func NewConnectionManager ¶
func NewConnectionManager(endpoint Endpoint) *ConnectionManager
NewConnectionManager returns an initialized ConnectionManager
func (*ConnectionManager) CloseConnection ¶
func (cm *ConnectionManager) CloseConnection(conn net.Conn)
CloseConnection closes a connection on the client side
func (*ConnectionManager) NewConnection ¶
NewConnection returns an initialized connection to the intake. It blocks until a connection is available
type Delimiter ¶
type Delimiter interface {
// contains filtered or unexported methods
}
Delimiter is responsible for adding delimiters to the frames being sent.
type Destination ¶
type Destination struct {
// contains filtered or unexported fields
}
Destination is responsible for shipping logs to a remote server over TCP.
func AddrToDestination ¶
func AddrToDestination(addr net.Addr, ctx *DestinationsContext) *Destination
AddrToDestination creates a Destination from an Addr
func NewDestination ¶
func NewDestination(endpoint Endpoint, destinationsContext *DestinationsContext) *Destination
NewDestination returns a new destination.
func (*Destination) Send ¶
func (d *Destination) Send(payload []byte) error
Send transforms a message into a frame and sends it to a remote server, returns an error if the operation failed.
func (*Destination) SendAsync ¶
func (d *Destination) SendAsync(payload []byte)
SendAsync sends a message to the destination without blocking. If the channel is full, the incoming messages will be dropped
type Destinations ¶
type Destinations struct { Main *Destination Additionals []*Destination }
Destinations holds the main destination and additional ones to send logs to.
func NewDestinations ¶
func NewDestinations(main *Destination, additionals []*Destination) *Destinations
NewDestinations returns a new destinations composite.
type DestinationsContext ¶
type DestinationsContext struct {
// contains filtered or unexported fields
}
A DestinationsContext manages senders and allows us to "unclog" the pipeline when trying to stop it and failing to send messages.
func NewDestinationsContext ¶
func NewDestinationsContext() *DestinationsContext
NewDestinationsContext returns an initialized ConnectionManager
func (*DestinationsContext) Context ¶
func (dc *DestinationsContext) Context() context.Context
Context allows one to access the current context of this DestinationsContext.
func (*DestinationsContext) Start ¶
func (dc *DestinationsContext) Start()
Start creates a context that will be cancelled on Stop()
func (*DestinationsContext) Stop ¶
func (dc *DestinationsContext) Stop()
Stop cancels the context that should be used by all senders.
type Endpoint ¶
type Endpoint struct { APIKey string `mapstructure:"api_key"` Host string Port int UseSSL bool UseProto bool ProxyAddress string }
Endpoint holds all the organization and network parameters to send logs to Datadog.
func AddrToEndPoint ¶
AddrToEndPoint creates an EndPoint from an Addr.
type Endpoints ¶
Endpoints holds the main endpoint and additional ones to dualship logs.
func NewEndpoints ¶
NewEndpoints returns a new endpoints composite.
type FramingError ¶
type FramingError struct {
// contains filtered or unexported fields
}
FramingError represents a kind of error that can occur when a log can not properly be transformed into a frame.
func NewFramingError ¶
func NewFramingError(err error) *FramingError
NewFramingError returns a new framing error.
func (*FramingError) Error ¶
func (e *FramingError) Error() string
Error returns the message of the error.