logstream

package
v0.0.0-...-379fbb2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package logstream is a sov RouteHandler plugin that streams container logs and stats as NDJSON (application/x-ndjson, one JSON object per line) over a chunked response. It is the server half of the frontend's loom-rpc @stream transport.

Auth is validated BEFORE the first byte: the bearer token rides the Authorization header (these are POST routes), and the container is checked to exist, so a failure still returns a normal error status. Once the stream starts, no status can be sent — see PipeStream.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

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

Plugin streams logs/stats for a container.

func New

func New(hs *hosts.Set, tm *auth.TokenManager, eng *deploy.Engine, bus *events.Bus) *Plugin

New returns the logstream plugin (active-host aware). eng drives the streaming deploy operations (apply/deploy/destroy).

func (*Plugin) Doc

func (p *Plugin) Doc() string

Doc surfaces a one-line description in introspect + explorer.

func (*Plugin) PluginName

func (p *Plugin) PluginName() string

PluginName surfaces in /rpc/_introspect.plugins[].

func (*Plugin) RoutePatterns

func (p *Plugin) RoutePatterns() []string

RoutePatterns claims the exact stream paths.

func (*Plugin) ServeRoute

func (p *Plugin) ServeRoute(ctx context.Context, req *gateway.Request) *gateway.Response

ServeRoute validates auth + the target container, then returns an NDJSON stream. Validation happens before any bytes are written.

Jump to

Keyboard shortcuts

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