Documentation
¶
Overview ¶
Package log provides log viewing operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Darwin ¶
type Darwin struct{}
Darwin implements the Provider interface for Darwin (macOS). All methods return ErrUnsupported as log management is not available on macOS.
func NewDarwinProvider ¶
func NewDarwinProvider() *Darwin
NewDarwinProvider factory to create a new Darwin instance.
func (*Darwin) ListSources ¶
ListSources returns ErrUnsupported on Darwin.
type Debian ¶
type Debian struct {
provider.FactsAware
// contains filtered or unexported fields
}
Debian implements the Provider interface for Debian-family systems using journalctl for log querying.
func NewDebianProvider ¶
NewDebianProvider factory to create a new Debian instance.
func (*Debian) ListSources ¶
ListSources returns unique syslog identifiers from the journal.
type Entry ¶
type Entry struct {
Timestamp string `json:"timestamp"`
Unit string `json:"unit,omitempty"`
Priority string `json:"priority"`
Message string `json:"message"`
PID int `json:"pid,omitempty"`
Hostname string `json:"hostname,omitempty"`
}
Entry represents a single journal entry.
type Linux ¶
type Linux struct{}
Linux implements the Provider interface for generic Linux. All methods return ErrUnsupported as this is a generic Linux stub.
func NewLinuxProvider ¶
func NewLinuxProvider() *Linux
NewLinuxProvider factory to create a new Linux instance.
func (*Linux) ListSources ¶
ListSources returns ErrUnsupported on generic Linux.
type Provider ¶
type Provider interface {
// Query returns journal entries with optional filtering.
Query(ctx context.Context, opts QueryOpts) ([]Entry, error)
// QueryUnit returns journal entries for a specific systemd unit.
QueryUnit(ctx context.Context, unit string, opts QueryOpts) ([]Entry, error)
// ListSources returns unique syslog identifiers from the journal.
ListSources(ctx context.Context) ([]string, error)
}
Provider implements log viewing operations.