Documentation ¶
Index ¶
Constants ¶
const ( TextContentType = "text/plain" JSONContentType = "application/json" ProtobufContentType = "application/x-protobuf" )
ContentType options,
Variables ¶
This section is empty.
Functions ¶
func CheckConnectivity ¶
func CheckConnectivity(endpoint config.Endpoint, cfg pkgconfigmodel.Reader) config.HTTPConnectivity
CheckConnectivity check if sending logs through HTTP works
Types ¶
type Destination ¶
type Destination struct {
// contains filtered or unexported fields
}
Destination sends a payload over HTTP.
func NewDestination ¶
func NewDestination(endpoint config.Endpoint, contentType string, destinationsContext *client.DestinationsContext, maxConcurrentBackgroundSends int, shouldRetry bool, telemetryName string, cfg pkgconfigmodel.Reader) *Destination
NewDestination returns a new Destination. If `maxConcurrentBackgroundSends` > 0, then at most that many background payloads will be sent concurrently, else there is no concurrency and the background sending pipeline will block while sending each payload. TODO: add support for SOCKS5
func (*Destination) IsMRF ¶ added in v0.54.0
func (d *Destination) IsMRF() bool
IsMRF indicates that this destination is a Multi-Region Failover destination.
func (*Destination) Start ¶
func (d *Destination) Start(input chan *message.Payload, output chan *message.Payload, isRetrying chan bool) (stopChan <-chan struct{})
Start starts reading the input channel
func (*Destination) Target ¶
func (d *Destination) Target() string
Target is the address of the destination.
type StatusCodeContainer ¶
StatusCodeContainer is a lock around the status code to return
type SyncDestination ¶ added in v0.56.0
type SyncDestination struct {
// contains filtered or unexported fields
}
SyncDestination sends a payload over HTTP and does not retry. In Serverless, the retry and backoff logic is handled by the serverless flush strategy
func NewSyncDestination ¶ added in v0.56.0
func NewSyncDestination(endpoint config.Endpoint, contentType string, destinationsContext *client.DestinationsContext, senderDoneChan chan *sync.WaitGroup, telemetryName string, cfg pkgconfigmodel.Reader) *SyncDestination
NewSyncDestination returns a new synchronous Destination.
func (*SyncDestination) IsMRF ¶ added in v0.56.0
func (d *SyncDestination) IsMRF() bool
IsMRF indicates that this destination is a Multi-Region Failover destination.
func (*SyncDestination) Start ¶ added in v0.56.0
func (d *SyncDestination) Start(input chan *message.Payload, output chan *message.Payload, _ chan bool) (stopChan <-chan struct{})
Start starts reading the input channel
func (*SyncDestination) Target ¶ added in v0.56.0
func (d *SyncDestination) Target() string
Target is the address of the destination.
type TestServer ¶
type TestServer struct { DestCtx *client.DestinationsContext Destination *Destination Endpoint config.Endpoint // contains filtered or unexported fields }
TestServer a test server
func NewTestServer ¶
func NewTestServer(statusCode int, cfg pkgconfigmodel.Reader) *TestServer
NewTestServer creates a new test server
func NewTestServerWithOptions ¶
func NewTestServerWithOptions(statusCode int, senders int, retryDestination bool, respondChan chan int, cfg pkgconfigmodel.Reader) *TestServer
NewTestServerWithOptions creates a new test server with concurrency and response control
func (*TestServer) ChangeStatus ¶
func (s *TestServer) ChangeStatus(statusCode int)
ChangeStatus changes the status to return