writer

package
v0.0.0-...-e951c9a Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogEntry = "%s %s\n"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Push

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

Push is a io.Writer, that writes given log entries by pushing directly to the given loki server URL. Each `Push` instance handles for a single tenant. No batching of log lines happens when sending to Loki.

func NewPush

func NewPush(
	lokiAddr, tenantID string,
	timeout time.Duration,
	cfg config.HTTPClientConfig,
	labelName, labelValue string,
	streamName, streamValue string,
	tlsCfg *tls.Config,
	caFile string,
	username, password string,
	backoffCfg *backoff.Config,
	logger log.Logger,
) (*Push, error)

NewPush creates an instance of `Push` which writes logs directly to given `lokiAddr`

func (*Push) Write

func (p *Push) Write(payload []byte) (int, error)

Write implements the io.Writer.

type Writer

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

func NewWriter

func NewWriter(
	writer io.Writer,
	sentChan chan time.Time,
	entryInterval, outOfOrderMin, outOfOrderMax time.Duration,
	outOfOrderPercentage, entrySize int,
	logger log.Logger,
) *Writer

func (*Writer) Stop

func (w *Writer) Stop()

Jump to

Keyboard shortcuts

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