logfollow

package
v0.46.3 Latest Latest
Warning

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

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

Documentation

Overview

Package logfollow contains shared CLI log stream follow loops.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deployment

func Deployment(ctx context.Context, deps cliruntime.Deps, w io.Writer, stream *api.ProjectLogStream, cancel context.CancelFunc, terminal TerminalCheck, catchUp CatchUp) error

Deployment prints a deployment log stream until the deployment reaches a terminal status, then runs catchUp with the IDs already printed from the stream. If the stream closes before the deployment is terminal, it keeps polling so the catch-up search still runs.

func Runtime

func Runtime(ctx context.Context, deps cliruntime.Deps, w io.Writer, open StreamOpener) error

Runtime follows a runtime log stream until the context is canceled. The backend holds a healthy connection open and tails new events, so a closed stream is treated as a transient disconnect: Runtime reconnects from the last stream cursor — resuming without replaying recent events — until the context is canceled. A failure to open the stream is surfaced to the caller.

func RuntimeWithStreamOpened added in v0.1.0

func RuntimeWithStreamOpened(ctx context.Context, deps cliruntime.Deps, w io.Writer, open StreamOpener, opened func()) error

RuntimeWithStreamOpened follows runtime logs like Runtime and invokes opened once after the first stream connection succeeds. Callers use this to render API instructions that arrive in the stream response headers before a healthy follow session blocks indefinitely.

Types

type CatchUp

type CatchUp func(context.Context, map[string]struct{}) error

CatchUp runs after a followed deployment reaches a terminal status.

type StreamOpener

type StreamOpener func(ctx context.Context, lastEventID string) (*api.ProjectLogStream, error)

StreamOpener opens a project log stream, resuming after lastEventID when it is set. logfollow re-invokes it to reconnect a dropped stream from its last cursor.

type TerminalCheck

type TerminalCheck func(context.Context) (bool, error)

TerminalCheck reports whether a followed deployment has reached a terminal status.

Jump to

Keyboard shortcuts

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