loki_client

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Username string
	Password string
}

type ClientOpts

type ClientOpts struct {
	Logger    logging.Logger
	BasicAuth *BasicAuth
}

type LogResult

type LogResult struct {
	Data struct {
		Result []struct {
			Stream map[string]string `json:"stream,omitempty"`
			Values [][]string        `json:"values,omitempty"`
		} `json:"result,omitempty"`
	} `json:"data"`
}

type LokiClient

type LokiClient interface {
	Ping(ctx context.Context) error
	GetLogs(args QueryArgs) ([]byte, error)
	TailLogs(args QueryArgs, writer io.WriteCloser) error
	Close()
}

func NewLokiClient

func NewLokiClient(httpAddr string, opts ClientOpts) (LokiClient, error)

type PreWriteFunc

type PreWriteFunc func(log *LogResult) ([]byte, error)

type QueryArgs

type QueryArgs struct {
	StreamSelectors []StreamSelector
	SearchKeyword   *string
	StartTime       *time.Time
	EndTime         *time.Time
	LimitLength     *int

	PreWriteFunc PreWriteFunc
}

type StreamSelector

type StreamSelector struct {
	Key       string
	Value     string
	Operation string
}

Jump to

Keyboard shortcuts

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