netutil

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 13 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 (
	DefaultNetworkName = "bridge"
	DefaultID          = 0
	DefaultCIDR        = "10.4.0.0/24"
)
View Source
const ConfigListTemplate = `` /* 687-byte string literal not displayed */

ConfigListTemplate was copied from https://github.com/containers/podman/blob/v2.2.0/cni/87-podman-bridge.conflist

Variables

This section is empty.

Functions

func AcquireNextID

func AcquireNextID(l []*NetworkConfigList) (int, error)

AcquireNextID suggests the next ID.

func NerdctlID

func NerdctlID(b []byte) *int

Types

type CNIEnv

type CNIEnv struct {
	Path        string
	NetconfPath string
}

type ConfigListTemplateOpts

type ConfigListTemplateOpts struct {
	ID           int
	Name         string // e.g. "nerdctl"
	Subnet       string // e.g. "10.4.0.0/16"
	Gateway      string // e.g. "10.4.0.1"
	ExtraPlugins string // e.g. `,{"type":"isolation"}`
}

type NetworkConfigList

type NetworkConfigList struct {
	*libcni.NetworkConfigList
	NerdctlID *int
	File      string
}

func ConfigLists

func ConfigLists(e *CNIEnv) ([]*NetworkConfigList, error)

ConfigLists loads config from dir if dir exists. The result also contains DefaultConfigList

func DefaultConfigList

func DefaultConfigList(e *CNIEnv) (*NetworkConfigList, error)

func GenerateConfigList

func GenerateConfigList(e *CNIEnv, id int, name, cidr string) (*NetworkConfigList, error)

GenerateConfigList creates NetworkConfigList. GenerateConfigList does not fill "File" field.

TODO: enable CNI isolation plugin

Jump to

Keyboard shortcuts

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