logdir

package
v0.0.0-...-3c2e606 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

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

Loader loads all runs under a log directory and accumulates their contents.

func (*Loader) Close

func (ll *Loader) Close() error

Close implements io.Closer. If there are multiple errors when closing underlying run readers, an arbitrary one is returned.

func (*Loader) Reload

func (ll *Loader) Reload()

Reload polls the log directory and reloads runs. It blocks until the reload finishes. Must not be called concurrently with any other Reload. May be called concurrently with reads.

func (*Loader) Run

func (ll *Loader) Run(run string) *run.Accumulator

Run returns the accumulator for the run with the given name (not path), or nil if there is no such run.

func (*Loader) Runs

func (ll *Loader) Runs() map[string]*run.Accumulator

Runs returns a map of all runs, keyed by name. The returned map is owned by the caller; its values are not.

type LoaderBuilder

type LoaderBuilder struct {
	// FS is the filesystem to use for read operations.
	FS fs.Filesystem
	// Logdir is the root log directory to be loaded, as a path under FS.
	Logdir string
}

LoaderBuilder specifies options for a Loader.

func (LoaderBuilder) Start

func (b LoaderBuilder) Start() *Loader

Start starts a loader in a new goroutine. It starts dormant. Call Reload on returned *Loader to poll.

Jump to

Keyboard shortcuts

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