network

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 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 EncryptionConfig added in v0.0.3

type EncryptionConfig struct {
	Enabled   bool   `yaml:"enabled"`
	IPSecMode string `yaml:"ipsecMode,omitempty"` // "default", "strict"
	DataPath  string `yaml:"dataPath,omitempty"`  // "encrypted", "unencrypted"
}

EncryptionConfig defines network encryption settings

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

type NetworkEncryption added in v0.0.3

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

NetworkEncryption manages Docker Swarm network encryption

func NewNetworkEncryption added in v0.0.3

func NewNetworkEncryption(client *ssh.Client, verbose bool) *NetworkEncryption

NewNetworkEncryption creates a new network encryption manager

func (*NetworkEncryption) CreateEncryptedNetwork added in v0.0.3

func (n *NetworkEncryption) CreateEncryptedNetwork(networkName string, subnet string) error

CreateEncryptedNetwork creates a new encrypted overlay network

func (*NetworkEncryption) EnableEncryption added in v0.0.3

func (n *NetworkEncryption) EnableEncryption(networkName string) error

EnableEncryption enables encryption on a Docker overlay network Docker Swarm uses IPsec encryption for overlay networks when --opt encrypted is set

func (*NetworkEncryption) EnableSwarmAutolock added in v0.0.3

func (n *NetworkEncryption) EnableSwarmAutolock() (string, error)

EnableSwarmAutolock enables Swarm autolock for manager node encryption

func (*NetworkEncryption) EnsureProjectNetworkEncrypted added in v0.0.3

func (n *NetworkEncryption) EnsureProjectNetworkEncrypted(projectName, environment string) error

EnsureProjectNetworkEncrypted ensures the project network is encrypted

func (*NetworkEncryption) GetNetworkStatus added in v0.0.3

func (n *NetworkEncryption) GetNetworkStatus() (map[string]bool, error)

GetNetworkStatus returns the encryption status of all overlay networks

func (*NetworkEncryption) GetSwarmUnlockKey added in v0.0.3

func (n *NetworkEncryption) GetSwarmUnlockKey() (string, error)

GetSwarmUnlockKey retrieves the current Swarm unlock key

func (*NetworkEncryption) IsNetworkEncrypted added in v0.0.3

func (n *NetworkEncryption) IsNetworkEncrypted(networkName string) (bool, error)

IsNetworkEncrypted checks if a network has encryption enabled

func (*NetworkEncryption) RecreateNetworkWithEncryption added in v0.0.3

func (n *NetworkEncryption) RecreateNetworkWithEncryption(networkName string) error

RecreateNetworkWithEncryption recreates a network with encryption enabled WARNING: This will disconnect all services from the network

func (*NetworkEncryption) RotateSwarmUnlockKey added in v0.0.3

func (n *NetworkEncryption) RotateSwarmUnlockKey() (string, error)

RotateSwarmUnlockKey rotates the Swarm unlock key

Jump to

Keyboard shortcuts

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