http

package
v0.68.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: Apache-2.0 Imports: 25 Imported by: 4

Documentation

Overview

Package http provides an HTTP destination for logs.

Index

Constants

View Source
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

func CheckConnectivityDiagnose

func CheckConnectivityDiagnose(endpoint config.Endpoint, cfg pkgconfigmodel.Reader) (url string, err error)

func NewTestHTTPSServer added in v0.61.0

func NewTestHTTPSServer(forceHTTP1 bool) *httptest.Server

NewTestHTTPSServer creates a new test server that can support HTTP/2

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,
	shouldRetry bool,
	destMeta *client.DestinationMetadata,
	cfg pkgconfigmodel.Reader,
	minConcurrency int,
	maxConcurrency int,
	pipelineMonitor metrics.PipelineMonitor) *Destination

NewDestination returns a new Destination. minConcurrency denotes the minimum number of concurrent http requests the pipeline will allow at once. maxConcurrency represents the maximum number of concurrent http requests, reachable when the client is experiencing a large latency in sends. 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) Metadata added in v0.61.0

func (d *Destination) Metadata() *client.DestinationMetadata

Metadata returns the metadata of the 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

type StatusCodeContainer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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,
	destMeta *client.DestinationMetadata,
	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) Metadata added in v0.61.0

Metadata returns the metadata of the 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, concurrentSends 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

func (*TestServer) Stop

func (s *TestServer) Stop()

Stop stops the server

Jump to

Keyboard shortcuts

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