log

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator interface {
	// Listen causes an aggregator to begin consuming messages via its underlying transport
	// mechanism. Implementations of this must be non-blocking. Stop() can be called to stop the
	// aggregator.
	Listen() error
	// Stop stops the consumer and blocks until it stops or the configured duration passes. In the
	// latter case, returns an error of type ErrStopTimedOut
	Stop() error
	// Stopped returns a channel that will receive when the consumer has stopped. The error received
	// may be nil, which means it was stopped cleanly. A non-nil error means it stopped because it
	// errored.
	Stopped() <-chan error
}

Aggregator is an interface for pluggable components that collect log messages delivered via some transport mechanism

func NewAggregator

func NewAggregator(aggregatorType string, storageAdapter storage.Adapter) (Aggregator, error)

NewAggregator returns a pointer to an appropriate implementation of the Aggregator interface, as determined by the aggregatorType string it is passed.

type Docker

type Docker struct {
	ContainerID string `json:"container_id"`
}

Docker specific log message fields

type ErrStopTimedOut

type ErrStopTimedOut struct {
	Timeout time.Duration
}

ErrStopTimedOut is the error returned if a (Aggregator).Stop call times out before the stop is complete

func (ErrStopTimedOut) Error

func (e ErrStopTimedOut) Error() string

type Kubernetes

type Kubernetes struct {
	Namespace     string            `json:"namespace_name"`
	PodID         string            `json:"pod_id"`
	PodName       string            `json:"pod_name"`
	ContainerName string            `json:"container_name"`
	Labels        map[string]string `json:"labels"`
	Host          string            `json:"host"`
}

Kubernetes specific log message fields

type Message

type Message struct {
	Log        string     `json:"log"`
	Stream     string     `json:"stream"`
	Kubernetes Kubernetes `json:"kubernetes"`
	Docker     Docker     `json:"docker"`
	Time       time.Time  `json:"time"`
}

Message fields

Jump to

Keyboard shortcuts

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