docker

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectNetwork

func DetectNetwork(ctx context.Context, runner exec.Runner, network string) (string, error)

DetectNetwork validates the given network name, or auto-detects a custom Docker network if none is specified.

func EnsureImage

func EnsureImage(ctx context.Context, runner exec.Runner, image string) error

EnsureImage checks if the image exists locally and pulls it if not.

func StartCapture

func StartCapture(
	ctx context.Context, runner exec.Runner, image, network string,
	args ...string,
) (io.ReadCloser, func() error, error)

StartCapture starts the trcd container with host networking and returns a reader for its stdout (NDJSON stream). The trcd process captures traffic on the bridge interface (br-<id>) corresponding to the Docker network. The caller must call the returned cleanup function when done.

func StopCapture

func StopCapture(ctx context.Context, runner exec.Runner)

StopCapture idempotently stops and removes the trcd container.

Types

type ServiceMap

type ServiceMap map[string]string

ServiceMap maps container IP addresses to human-readable service names.

func ResolveServices

func ResolveServices(ctx context.Context, runner exec.Runner, network string) (ServiceMap, error)

ResolveServices queries the Docker network and builds a map from container IP to a cleaned-up service name.

Jump to

Keyboard shortcuts

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