logs

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRoute

func NewRoute(dp RouteDataProvider) web.Route

NewRoute returns the page for this folder.

Types

type DP

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

DP provides the log entries that match the page's query.

func NewDP

func NewDP(d *deps.Deps) *DP

NewDP returns the page's data provider.

func (*DP) Data

func (p *DP) Data(ctx context.Context, r *web.Request, _ web.ResponseWriter, data *RouteData) error

Data lists the apps for the filter and the entries that match the query.

func (*DP) Subscribe

func (p *DP) Subscribe(ctx context.Context, r *web.Request, state *ReactiveState) error

Subscribe lists the entries again at every change of the workspace.

type Entry

type Entry struct {
	Stamp   string // the time as RFC 3339
	Time    string
	App     string
	Source  string
	Level   string
	Class   string // level-<Level> for DEBUG, INFO, WARN and ERROR; "" for any other level
	Message string
	Attrs   string
	Trace   string // the trace id; "" when the entry has none, or one that is not a trace id
}

Entry is one log entry as the page shows it.

type Logs

type Logs struct {
	// Entries are the newest entries, newest first.
	Entries []Entry
	// Manual names the apps of the query that run by hand; their lines never reach aicoded dev.
	Manual []string
	// Problem is why the entries could not be listed.
	Problem string
}

Logs is what the page shows of the entries that match its query.

type Query

type Query = devapi.LogQuery

Query is what the page lists.

type ReactiveState

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

ReactiveState sends new values of the page's live variables to one open page. Its Set methods may be called from any goroutine.

func (*ReactiveState) SetLogs

func (rs *ReactiveState) SetLogs(v Logs)

SetLogs stores v as logs and sends the parts of the page that show it.

type RouteData

type RouteData struct {
	Logs  Logs
	Names []string
	Query Query
}

RouteData holds the variables the template declares with <ssr:var>.

type RouteDataProvider

type RouteDataProvider interface {
	Data(ctx context.Context, r *web.Request, w web.ResponseWriter, data *RouteData) error
	// Subscribe runs while the page is open and must return when ctx is done.
	Subscribe(ctx context.Context, r *web.Request, state *ReactiveState) error
}

RouteDataProvider is what this page's DP implements.

Jump to

Keyboard shortcuts

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