container

package
v0.1.97 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package container follows Docker Engine API logs through a unix socket. DOCKER_HOST selects a unix socket; when unset, /var/run/docker.sock is used. A Podman Docker-compatible socket can be used with Runtime set to "podman". Containerd's native API and TTY streams are not supported.

FollowOptions.Container selects an ID or name, Since bounds the start time, Tail passes Docker's tail value, and Follow keeps the stream open. Emit is called synchronously for each line and should return promptly. Host defaults to the local hostname and Runtime defaults to "docker". Lines reaching 64 KiB are emitted in chunks with the label truncated=true. Cancellation flushes partial lines and returns the unwrapped context error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Follow

func Follow(ctx context.Context, opts FollowOptions) (result error)

Follow emits lines until the stream ends or the context is cancelled.

Types

type FollowOptions

type FollowOptions struct {
	Container string
	Host      string
	Runtime   string
	Since     time.Time
	Tail      string
	Follow    bool
	Emit      func(logs.LogLine)
}

FollowOptions selects a container and controls the Docker logs request.

Jump to

Keyboard shortcuts

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