network

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager handles Docker network operations

func NewManager

func NewManager(client *ssh.Client, projectName string, environment string, verbose bool) *Manager

NewManager creates a new network manager

func (*Manager) ConnectContainer

func (m *Manager) ConnectContainer(containerName string, aliases []string) error

ConnectContainer connects a container to the project network

func (*Manager) ConnectToExternalNetwork

func (m *Manager) ConnectToExternalNetwork(containerName, targetProject string, targetEnvironment string) error

ConnectToExternalNetwork connects a container to another project's network This enables cross-project service communication via Docker DNS targetEnvironment: environment of the target project (defaults to current environment if empty)

func (*Manager) DisconnectContainer

func (m *Manager) DisconnectContainer(containerName string) error

DisconnectContainer disconnects a container from the project network

func (*Manager) EnsureContainerConnectedToAllNetworks

func (m *Manager) EnsureContainerConnectedToAllNetworks(containerName string) error

EnsureContainerConnectedToAllNetworks ensures a container (like Traefik) is connected to all project networks

func (*Manager) EnsureNetwork

func (m *Manager) EnsureNetwork() error

EnsureNetwork creates the Docker network if it doesn't exist

func (*Manager) GetAllProjectNetworks

func (m *Manager) GetAllProjectNetworks() ([]string, error)

GetAllProjectNetworks returns a list of all Tako project networks

func (*Manager) GetContainerIP

func (m *Manager) GetContainerIP(containerName string) (string, error)

GetContainerIP returns the IP address of a container in the network

func (*Manager) GetContainerNetworks

func (m *Manager) GetContainerNetworks(containerName string) ([]string, error)

GetContainerNetworks returns a list of networks a container is connected to

func (*Manager) GetNetworkInfo

func (m *Manager) GetNetworkInfo() (string, error)

GetNetworkInfo returns information about the network

func (*Manager) GetNetworkName

func (m *Manager) GetNetworkName() string

GetNetworkName returns the Docker network name for the project and environment

func (*Manager) ListConnectedContainers

func (m *Manager) ListConnectedContainers() ([]string, error)

ListConnectedContainers lists all containers connected to the network

func (*Manager) RemoveNetwork

func (m *Manager) RemoveNetwork() error

RemoveNetwork removes the Docker network

Jump to

Keyboard shortcuts

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