network

package
v0.2.8-rc5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: AGPL-3.0 Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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