loki

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a Loki client.

func NewClient

func NewClient(ctx context.Context, url *url.URL, username string, password string, caCert string, labels []string, logLevel string, types []string) *Client

NewClient returns a Client.

func (*Client) HandleEvent

func (c *Client) HandleEvent(event api.Event)

HandleEvent handles the event received from the internal event listener.

func (*Client) Stop

func (c *Client) Stop()

Stop the client.

type Entry

type Entry struct {
	Timestamp time.Time
	Line      string
}

Entry represents a log entry. It includes a log message and the time it occurred at.

func (Entry) MarshalJSON

func (e Entry) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of Entry.

type LabelSet

type LabelSet map[string]string

LabelSet is a key/value pair mapping of labels.

func (LabelSet) String

func (l LabelSet) String() string

String implements the Stringer interface. It returns a formatted/sorted set of label key/value pairs.

type PushRequest

type PushRequest struct {
	Streams []*Stream `json:"streams"`
}

PushRequest models a log stream push.

type Stream

type Stream struct {
	Labels  LabelSet `json:"stream"`
	Entries []Entry  `json:"values"`
}

Stream represents a log stream. It includes a set of log entries and their labels.

Jump to

Keyboard shortcuts

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