Documentation
¶
Index ¶
- Constants
- Variables
- func GetDefaultCredentialsForKind(kind string) ([]string, error)
- func Register(names []string, initFn Initializer)
- func SetDefaultCredentials(kindnames []string, user, password string) error
- func SetNonDefaultRuntimePerKind(kindnames []string, runtime string) error
- type Initializer
- type Node
- type NodeOption
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
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
SetDefaultCredentials register default credentials per provided kindname
func SetNonDefaultRuntimePerKind ¶ added in v0.27.0
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
Click to show internal directories.
Click to hide internal directories.