http

package
v0.0.0-...-5655933 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TextContentType = "text/plain"
	JSONContentType = "application/json"
)

ContentType options,

Variables

This section is empty.

Functions

func CheckConnectivity

func CheckConnectivity(endpoint logsconfig.Endpoint) logsconfig.HTTPConnectivity

CheckConnectivity check if sending logs through HTTP works

Types

type ContentEncoding

type ContentEncoding interface {
	// contains filtered or unexported methods
}

ContentEncoding encodes the payload

var IdentityContentType ContentEncoding = &identityContentType{}

IdentityContentType encodes the payload using the identity function

type Destination

type Destination struct {
	// contains filtered or unexported fields
}

Destination sends a payload over HTTP.

func NewDestination

func NewDestination(endpoint logsconfig.Endpoint, contentType string, destinationsContext *client.DestinationsContext, maxConcurrentBackgroundSends int) *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) Send

func (d *Destination) Send(payload []byte) error

Send sends a payload over HTTP, the error returned can be retryable and it is the responsibility of the callee to retry.

func (*Destination) SendAsync

func (d *Destination) SendAsync(payload []byte)

SendAsync sends a payload in background.

type GzipContentEncoding

type GzipContentEncoding struct {
	// contains filtered or unexported fields
}

GzipContentEncoding encodes the payload using gzip algorithm

func NewGzipContentEncoding

func NewGzipContentEncoding(level int) *GzipContentEncoding

NewGzipContentEncoding creates a new Gzip content type

Jump to

Keyboard shortcuts

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