nodes

package
v0.32.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: BSD-3-Clause Imports: 5 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"

	NodeKindBridge = "bridge"

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

Variables

View Source
var (
	NodeKind string
	// a map of node kinds overriding the default global runtime.
	NonDefaultRuntimes = map[string]string{}

	// Nodes is a map of all supported kinds and their init functions.
	Nodes = map[string]Initializer{}

	DefaultConfigTemplates = map[string]string{
		"vr-sros": "",
	}

	// ErrCommandExecError is an error returned when a command is failed to execute on a given node.
	ErrCommandExecError = errors.New("command execution error")
)

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