source

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelDebug = "debug"
	LevelInfo  = "info"
	LevelWarn  = "warn"
	LevelError = "error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerSource

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

DockerSource streams logs from one or more Docker containers.

func NewDockerSource

func NewDockerSource(services []string) (*DockerSource, error)

func (*DockerSource) Close

func (d *DockerSource) Close() error

func (*DockerSource) Name

func (d *DockerSource) Name() string

func (*DockerSource) Stream

func (d *DockerSource) Stream(ctx context.Context) (<-chan LogEntry, error)

func (*DockerSource) WatchNewContainers

func (d *DockerSource) WatchNewContainers(ctx context.Context)

type FileSource

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

func NewFileSource

func NewFileSource(patterns []string) (*FileSource, error)

NewFileSource creates a FileSource that tails from EOF — for live watch/tail commands.

func NewFileSourceFromStart

func NewFileSourceFromStart(patterns []string) (*FileSource, error)

NewFileSourceFromStart creates a FileSource that reads from the beginning of each file — for query commands that need to scan historical log data.

func (*FileSource) Close

func (f *FileSource) Close() error

func (*FileSource) Name

func (f *FileSource) Name() string

func (*FileSource) Stream

func (f *FileSource) Stream(ctx context.Context) (<-chan LogEntry, error)

type KubeOptions

type KubeOptions struct {
	Namespace  string
	Labels     string
	PodPrefix  string
	Container  string
	Kubeconfig string
}

type KubeSource

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

func NewKubeSource

func NewKubeSource(opts KubeOptions) (*KubeSource, error)

func (*KubeSource) Close

func (k *KubeSource) Close() error

func (*KubeSource) Name

func (k *KubeSource) Name() string

func (*KubeSource) Stream

func (k *KubeSource) Stream(ctx context.Context) (<-chan LogEntry, error)

type LogEntry

type LogEntry struct {
	Timestamp time.Time
	Service   string
	Level     string
	Message   string
	Fields    map[string]any
	Raw       string
}

LogEntry is the normalized log line from any source

type Source

type Source interface {
	Name() string
	Stream(ctx context.Context) (<-chan LogEntry, error)
	Close() error
}

Source is implemented by docker, k8s, file, stdin

type StdinSource

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

func NewStdinSource

func NewStdinSource() *StdinSource

func (*StdinSource) Close

func (s *StdinSource) Close() error

func (*StdinSource) Name

func (s *StdinSource) Name() string

func (*StdinSource) Stream

func (s *StdinSource) Stream(ctx context.Context) (<-chan LogEntry, error)

Jump to

Keyboard shortcuts

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