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: 6 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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