logfollow

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 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.

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