client

package
v0.36.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type FilterJSON added in v0.36.1

type FilterJSON bool

FilterJSON indicates whether to output logs in JSON format.

type FilterLevel added in v0.36.1

type FilterLevel logger.Level

type FilterResources added in v0.36.1

type FilterResources []model.ManifestName

func (FilterResources) Matches added in v0.36.1

func (r FilterResources) Matches(name model.ManifestName) bool

type FilterSince added in v0.36.1

type FilterSince time.Time

FilterSince represents an absolute timestamp for time-based log filtering. Zero value (time.Time{}) means no time filter. The CLI layer converts duration flags (e.g., "5m") to timestamps.

type FilterSource added in v0.36.1

type FilterSource string
const (
	FilterSourceAll     FilterSource = "all"
	FilterSourceBuild   FilterSource = "build"
	FilterSourceRuntime FilterSource = "runtime"
)

func (FilterSource) String added in v0.36.1

func (s FilterSource) String() string

type FilterTail added in v0.36.1

type FilterTail int

FilterTail represents the number of lines to show from the end. -1 means no limit, 0+ means limit to that many lines.

type FollowFlag added in v0.36.1

type FollowFlag bool

type IncrementalPrinter added in v0.36.1

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

func NewIncrementalPrinter added in v0.36.1

func NewIncrementalPrinter(stdout Stdout) *IncrementalPrinter

func (*IncrementalPrinter) Print added in v0.36.1

func (p *IncrementalPrinter) Print(lines []logstore.LogLine)

func (*IncrementalPrinter) PrintNewline added in v0.36.1

func (p *IncrementalPrinter) PrintNewline()

type JSONLogLine added in v0.36.1

type JSONLogLine struct {
	Time       *string `json:"time,omitempty"`
	Resource   *string `json:"resource,omitempty"`
	Level      *string `json:"level,omitempty"`
	Message    *string `json:"message,omitempty"`
	SpanID     *string `json:"spanID,omitempty"`
	ProgressID *string `json:"progressID,omitempty"`
	BuildEvent *string `json:"buildEvent,omitempty"`
	Source     *string `json:"source,omitempty"`
}

JSONLogLine represents a log line in JSON format. Fields use pointer types so we can distinguish between "not included" (nil) and "included but empty" (pointer to empty string).

type JSONPrinter added in v0.36.1

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

JSONPrinter outputs log lines as JSON Lines (one JSON object per line).

func NewJSONPrinter added in v0.36.1

func NewJSONPrinter(stdout Stdout) *JSONPrinter

NewJSONPrinter creates a new JSON printer.

func (*JSONPrinter) Print added in v0.36.1

func (p *JSONPrinter) Print(lines []logstore.LogLine)

Print outputs log lines as JSON Lines.

func (*JSONPrinter) PrintNewline added in v0.36.1

func (p *JSONPrinter) PrintNewline()

PrintNewline writes a newline to output.

type LogFilter added in v0.36.1

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

func NewLogFilter added in v0.36.1

func NewLogFilter(
	source FilterSource,
	resources FilterResources,
	level FilterLevel,
	since FilterSince,
	tail FilterTail,
	jsonOutput FilterJSON,
) LogFilter

func (LogFilter) Apply added in v0.36.1

func (f LogFilter) Apply(lines []logstore.LogLine) []logstore.LogLine

func (LogFilter) ApplyWithOptions added in v0.36.1

func (f LogFilter) ApplyWithOptions(lines []logstore.LogLine, applyTail bool) []logstore.LogLine

ApplyWithOptions applies the filter with control over tail application.

func (LogFilter) ApplyWithoutTail added in v0.36.1

func (f LogFilter) ApplyWithoutTail(lines []logstore.LogLine) []logstore.LogLine

ApplyWithoutTail applies the filter but skips the tail limit. Use this for streaming batches after the initial history.

func (LogFilter) JSONOutput added in v0.36.1

func (f LogFilter) JSONOutput() bool

JSONOutput returns whether JSON output is enabled.

func (LogFilter) Matches added in v0.36.1

func (f LogFilter) Matches(line logstore.LogLine) bool

Matches Checks if this line matches the current filter. The implementation is identical to matchesFilter in web/src/OverviewLogPane.tsx. except for term filtering as tools like grep can be used from the CLI.

func (LogFilter) MatchesAll added in v0.36.1

func (f LogFilter) MatchesAll(line logstore.LogLine) bool

MatchesAll checks if this line matches all filters including time-based filtering.

func (LogFilter) SuppressPrefix added in v0.36.1

func (f LogFilter) SuppressPrefix() bool

don't need the resource name prefix if: - printing logs for only one resource - printing logs to json

func (LogFilter) Tail added in v0.36.1

func (f LogFilter) Tail() int

Tail returns the tail limit (-1 for no limit).

type LogPrinter added in v0.36.1

type LogPrinter interface {
	Print(lines []logstore.LogLine)
	PrintNewline()
}

LogPrinter is the interface for printing log lines.

func ProvideLogPrinter added in v0.36.1

func ProvideLogPrinter(filter LogFilter, stdout Stdout) LogPrinter

type LogStreamer added in v0.36.1

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

func NewLogStreamer added in v0.36.1

func NewLogStreamer(follow FollowFlag, url model.WebURL, filter LogFilter, printer LogPrinter) *LogStreamer

func (*LogStreamer) Stream added in v0.36.1

func (ls *LogStreamer) Stream(ctx context.Context) error

type Stdout added in v0.36.1

type Stdout io.Writer

func ProvideStdout added in v0.36.1

func ProvideStdout() Stdout

type TerminalStream added in v0.36.1

type TerminalStream struct {
	ProcessedLogs logstore.Checkpoint
	// contains filtered or unexported fields
}

func NewTerminalStream added in v0.36.1

func NewTerminalStream(printer *IncrementalPrinter, filter LogFilter, store store.RStore) *TerminalStream

func (*TerminalStream) OnChange added in v0.36.1

func (*TerminalStream) TearDown added in v0.36.1

func (h *TerminalStream) TearDown(ctx context.Context)

TODO(nick): We should change this API so that TearDown gets the RStore one last time.

type ViewHandler added in v0.36.1

type ViewHandler interface {
	Handle(v *proto_webview.View) error
}

type WebsocketConn added in v0.36.1

type WebsocketConn interface {
	NextReader() (int, io.Reader, error)
	Close() error
	NextWriter(messageType int) (io.WriteCloser, error)
}

type WebsocketReader added in v0.36.1

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

func (*WebsocketReader) Listen added in v0.36.1

func (wsr *WebsocketReader) Listen(ctx context.Context) error

Jump to

Keyboard shortcuts

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