config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 9

Documentation

Overview

Package config defines logger configuration

Index

Constants

View Source
const MaxRetries = 100

MaxRetries max event firing retry limit

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Command    string
	Args       []string
	URL        string
	Params     map[string]string
	MaxRetries int
}

Event represents an rotation event

func (*Event) Init

func (c *Event) Init()

Init initialises an event

type Format added in v0.3.0

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

Format url format

func (*Format) ExpandURL added in v0.3.0

func (r *Format) ExpandURL(t time.Time, URL string) string

func (*Format) Init added in v0.3.0

func (r *Format) Init(URL string)

type Rotation

type Rotation struct {
	EveryMs    int
	MaxEntries int
	Format
	URL   string
	Codec string
	Emit  *Event
	// contains filtered or unexported fields
}

Rotation rotation rotation config

func (*Rotation) ExpandURL

func (r *Rotation) ExpandURL(t time.Time, ID string) string

ExpandURL expand rotation Format with log sequence, time and ID

func (Rotation) ExpiryTime

func (r Rotation) ExpiryTime(created time.Time) *time.Time

ExpiryTime returns expiry time

func (*Rotation) Init

func (r *Rotation) Init()

Init initialises rotation

func (*Rotation) IsGzip

func (r *Rotation) IsGzip() bool

IsGzip returns true if gzip codec specified

type Stream

type Stream struct {
	//Rotation represents optional log stream rotation
	Rotation *Rotation
	FlushMod int    //flush module to be set only for local testing
	URL      string //destination URL

	Codec        string //compression codec
	StreamUpload bool   //streams controls progressive upload to s3, g3 (skip checkup)

	SamplePct *float64 //sample pct (0..100)
	// contains filtered or unexported fields
}

Stream represents log stream

func (*Stream) CanSample added in v0.6.6

func (s *Stream) CanSample() bool

CanSample returns true if sample pct is not configured or sample random value meets target

func (*Stream) Init

func (s *Stream) Init()

Init initialises log stream

func (*Stream) IsGzip

func (s *Stream) IsGzip() bool

IsGzip returns true if gzip codec specified

Jump to

Keyboard shortcuts

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