nodes

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// default connection mode for vrnetlab based containers
	VrDefConnMode = "tc"
	// keys for the map returned by GetImages
	ImageKey   = "image"
	KernelKey  = "kernel"
	SandboxKey = "sandbox"
)
View Source
const (
	NodeKindBridge = "bridge"

	NodeKindHOST = "host"
	NodeKindOVS  = "ovs-bridge"
	NodeKindSRL  = "srl"
)

Variables

View Source
var DefaultConfigTemplates = map[string]string{
	"vr-sros": "",
}
View Source
var NodeKind string
View Source
var Nodes = map[string]Initializer{}

Nodes is a map of all supported kinds and their init functions

View Source
var NonDefaultRuntimes = map[string]string{}

a map of node kinds overriding the default global runtime

Functions

func GetDefaultCredentialsForKind added in v0.27.0

func GetDefaultCredentialsForKind(kind string) ([]string, error)

GetDefaultCredentialsForKind retrieve the default credentials for a certain kind the first element in the slice is the Username, the second is the password

func Register

func Register(names []string, initFn Initializer)

func SetDefaultCredentials added in v0.27.0

func SetDefaultCredentials(kindnames []string, user, password string) error

SetDefaultCredentials register default credentials per provided kindname

func SetNonDefaultRuntimePerKind added in v0.27.0

func SetNonDefaultRuntimePerKind(kindnames []string, runtime string) error

SetNonDefaultRuntimePerKind sets a non default runtime for kinds that requires that (see cvx)

Types

type Initializer

type Initializer func() Node

type Node

type Node interface {
	Init(*types.NodeConfig, ...NodeOption) error
	Config() *types.NodeConfig
	PreDeploy(configName, labCADir, labCARoot string) error
	Deploy(context.Context) error
	PostDeploy(context.Context, map[string]Node) error
	WithMgmtNet(*types.MgmtNet)
	WithRuntime(runtime.ContainerRuntime)
	SaveConfig(context.Context) error
	Delete(context.Context) error
	GetImages() map[string]string
	GetRuntime() runtime.ContainerRuntime
}

type NodeOption

type NodeOption func(Node)

func WithMgmtNet

func WithMgmtNet(mgmt *types.MgmtNet) NodeOption

func WithRuntime

func WithRuntime(r runtime.ContainerRuntime) NodeOption

Jump to

Keyboard shortcuts

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