docker

package
v0.0.0-...-14c39a2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SidecarImage is the Docker image used for sidecar containers.
	SidecarImage = "btunnel-sidecar-agent:latest"

	// SidecarContainerPrefix is the naming prefix for sidecar containers.
	SidecarContainerPrefix = "btunnel-sidecar-"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerInfo

type ContainerInfo struct {
	ID       string
	Name     string
	IPv4Addr string
	IPv6Addr string
}

ContainerInfo represents a container connected to a network.

type NetworkInfo

type NetworkInfo struct {
	ID         string
	Name       string
	Driver     string
	Containers []ContainerInfo
}

NetworkInfo represents information about a Docker network.

type NetworkManager

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

NetworkManager handles Docker network discovery and manipulation.

func NewNetworkManager

func NewNetworkManager() (*NetworkManager, error)

NewNetworkManager creates a new Docker network manager.

func (*NetworkManager) Close

func (m *NetworkManager) Close() error

Close closes the Docker client.

func (*NetworkManager) FindNetwork

func (m *NetworkManager) FindNetwork(ctx context.Context, name string) (*NetworkInfo, error)

FindNetwork finds a Docker network by name.

func (*NetworkManager) InspectNetwork

func (m *NetworkManager) InspectNetwork(ctx context.Context, networkID string) (*NetworkInfo, error)

InspectNetwork returns detailed information about a network.

func (*NetworkManager) ListNetworks

func (m *NetworkManager) ListNetworks(ctx context.Context) ([]NetworkInfo, error)

ListNetworks returns all Docker networks.

type SidecarManager

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

SidecarManager manages sidecar containers for Docker network isolation.

func NewSidecarManager

func NewSidecarManager(networkName, targetAddress string) (*SidecarManager, error)

NewSidecarManager creates a new sidecar manager.

func (*SidecarManager) Close

func (s *SidecarManager) Close(ctx context.Context) error

Close cleans up the sidecar manager.

func (*SidecarManager) GetContainerIP

func (s *SidecarManager) GetContainerIP(ctx context.Context) (string, error)

GetContainerIP returns the IP address of the sidecar container within the target network.

func (*SidecarManager) GetSocketPath

func (s *SidecarManager) GetSocketPath() string

GetSocketPath returns the path to the Unix domain socket on the host machine.

func (*SidecarManager) Start

func (s *SidecarManager) Start(ctx context.Context) error

Start launches a sidecar container connected to the target Docker network.

func (*SidecarManager) Stop

func (s *SidecarManager) Stop(ctx context.Context) error

Stop removes the sidecar container.

Jump to

Keyboard shortcuts

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