loki

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Line

type Line struct {
	Name               sesamy.EventName `json:"name"`
	Params             any              `json:"params"`
	ClientID           string           `json:"client_id"`
	UserID             string           `json:"user_id,omitempty"`
	UserProperties     map[string]any   `json:"user_properties,omitempty"`
	Consent            *mpv2.Consent    `json:"consent,omitempty"`
	NonPersonalizedAds bool             `json:"non_personalized_ads,omitempty"`
	UserData           *mpv2.UserData   `json:"user_data,omitempty"`
	DebugMode          bool             `json:"debug_mode,omitempty"`
}

func (*Line) Marshal

func (l *Line) Marshal() ([]byte, error)

type Loki

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

func New

func New(l *zap.Logger, addr string, opts ...Option) *Loki

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

func (*Loki) Start

func (l *Loki) Start(ctx context.Context)

Start pulls lines out of the channel and sends them to Loki

func (*Loki) Stop

func (l *Loki) Stop()

Stop will cancel any ongoing requests and stop the goroutine listening for requests

func (*Loki) Write

func (l *Loki) Write(payload mpv2.Payload[any])

type Option

type Option func(*Loki)

func WithBackoffConfig

func WithBackoffConfig(v *backoff.Config) Option

func WithBatchSize

func WithBatchSize(v int) Option

func WithBufferSize

func WithBufferSize(v int) Option

func WithHTTPClient

func WithHTTPClient(v *http.Client) Option

func WithUserAgent

func WithUserAgent(v string) Option

Jump to

Keyboard shortcuts

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