nad

package
v0.0.0-...-984f6f0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CniVersion = "0.3.1"
	// cni types
	WirePluginType   = "wire"
	TuningPluginType = "tuning"
)

Variables

View Source
var Plugins = map[string]PluginConfigInterface{
	"WirePlugin":   WirePlugin{},
	"TuningPlugin": TuningPlugin{},
}

key = type; plugin should become a init fn

Functions

func GetNadAnnotation

func GetNadAnnotation(nads []*nadv1.NetworkAttachmentDefinition) ([]byte, error)

func GetNadConfig

func GetNadConfig(plugins []PluginConfigInterface) ([]byte, error)

Types

type Capabilities

type Capabilities struct {
	Ips bool `json:"ips,omitempty"`
	Mac bool `json:"mac,omitempty"`
}

type NadAnnotation

type NadAnnotation []NadAnnotationEntry

type NadAnnotationEntry

type NadAnnotationEntry struct {
	Name string `json:"name,omitempty"`
}

type NadConfig

type NadConfig struct {
	CniVersion string           `json:"cniVersion,omitempty"`
	Plugins    []map[string]any `json:"plugins,omitempty"`
}

type PluginCniType

type PluginCniType struct {
	Type string `json:"type,omitempty"`
	Name string `json:"name,omitempty"`
}

type PluginConfigInterface

type PluginConfigInterface interface{}

type TuningPlugin

type TuningPlugin struct {
	PluginCniType
	Capabilities
}

type WirePlugin

type WirePlugin struct {
	PluginCniType
	InterfaceName string `json:"interfaceName,omitempty"`
	MTU           int    `json:"mtu,omitempty"`
}

Jump to

Keyboard shortcuts

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