http

package
v0.54.0-devel Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 23 Imported by: 2

Documentation

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)

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) IsHA

func (d *Destination) IsHA() bool

IsHA indicates that this destination is a High Availability 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 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

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