docker

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 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 MessageReader

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

MessageReader is a reder log source that reads docker logs.

func (*MessageReader) MessageRead

func (dls *MessageReader) MessageRead(ctx context.Context) (*logspray.Message, error)

MessageRead implements the LogSourcer interface

type Opt

type Opt func(*Watcher) error

Opt is a type for configuration options for the docker Watcher

func WithDockerClient

func WithDockerClient(cli *client.Client) Opt

WithDockerClient sets the default docker client

func WithEnvVarWhiteList

func WithEnvVarWhiteList(evwl []*regexp.Regexp) Opt

WithEnvVarWhiteList lets you set a selection of regular experessions to match against the container environment variables

func WithPoll added in v0.2.7

func WithPoll(poll bool) Opt

WithPoll sets the default docker client

func WithRoot

func WithRoot(root string) Opt

WithRoot sets the docker root to read files from

type Watcher

type Watcher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Watcher watches for files being added and removed from a filesystem

func New

func New(opts ...Opt) (*Watcher, error)

New creates a watcher that reports on the apperance, and dissapearance of sources

func (*Watcher) Next

func (w *Watcher) Next(ctx context.Context) ([]*sources.Update, error)

Next should be called each time you wish to watch for an update.

func (*Watcher) ReadTarget

func (w *Watcher) ReadTarget(ctx context.Context, id string, fromStart bool) (sources.MessageReader, error)

ReadTarget creates a new docker log source

Jump to

Keyboard shortcuts

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