network

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_SUBNET = 184549120 // 10.255.255.0
View Source
const MIN_SUBNET = 167772160 // 10.0.0.0
View Source
const SUBNET_OFFSET = 256

Variables

This section is empty.

Functions

func DeleteNetwork

func DeleteNetwork(containerName string) error
func GetBridgeVethLinks() (map[string]*Bridge, error)

Returns bridges with veth links from the host system

func IsCNIAvailable

func IsCNIAvailable() error

IsCNIAvailable checks if CNI path and all required plugins exist

func PurgeBridgeNetwork

func PurgeBridgeNetwork(bridge *Bridge) error

func PurgeNetworks

func PurgeNetworks() error

func RepairNetwork

func RepairNetwork(containerName string) error

func StartNetwork

func StartNetwork(containerName string, netConfig dto.NetworkConfig) (map[string][]any, net.IP, net.IP, error)

func WriteStringToResolvConf

func WriteStringToResolvConf(ctx context.Context, task containerd.Task, content string) error

Types

type Bridge

type Bridge struct {
	Link      netlink.Link
	VethLinks []netlink.Link
}

type IP

type IP struct {
	Address string `json:"address"`
	Gateway string `json:"gateway"`
}

func GetNetworkConfig

func GetNetworkConfig(container string) []IP

type IPAddresses

type IPAddresses struct {
	Addresses []IP `json:"ips"`
}

type PurgedNetworkInfo

type PurgedNetworkInfo struct {
	CNIPaths []string `json:"cni_paths"`
	Bridges  []string `json:"bridges"`
}

Jump to

Keyboard shortcuts

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