Documentation
¶
Index ¶
- Variables
- func Entrypoint() (*cobra.Command, error)
- func NewGoTTYNode(name, image, network string, port uint, username, password, shell string, ...) clabruntime.Node
- func NewSSHXNode(name, image, network, labName string, enableReaders bool, ...) clabruntime.Node
- func PrintContainerInspect(containers []clabruntime.GenericContainer, o *Options) error
- func SignalHandledContext() (context.Context, context.CancelFunc)
- type APIServerListItem
- type APIServerNode
- type ConfigOptions
- type DeployOptions
- type DestroyOptions
- type EventsOptions
- type ExecOptions
- type FilterOptions
- type GlobalOptions
- type GoTTYListItem
- type GraphOptions
- type InspectOptions
- type Manager
- type Options
- type SSHXListItem
- type SnapshotCollection
- type SnapshotResult
- type ToolsApiOptions
- type ToolsCertOptions
- type ToolsDisableTxOffloadOptions
- type ToolsGoTTYOptions
- type ToolsNetemOptions
- type ToolsSSHXOptions
- type ToolsSnapshotOptions
- type ToolsVethOptions
- type ToolsVxlanOptions
- type VersionOptions
Constants ¶
This section is empty.
Variables ¶
var (
Version = "0.0.0"
)
Version variables set at build time (e.g., with -ldflags).
Functions ¶
func Entrypoint ¶ added in v0.70.0
Entrypoint returns the root cobra command to be executed or errors if it cannot do so.
func NewGoTTYNode ¶ added in v0.69.0
func NewGoTTYNode( name, image, network string, port uint, username, password, shell string, labels map[string]string, ) clabruntime.Node
NewGoTTYNode creates a new GoTTY node configuration.
func NewSSHXNode ¶ added in v0.68.0
func NewSSHXNode( name, image, network, labName string, enableReaders bool, labels map[string]string, mountSSH bool, ) clabruntime.Node
NewSSHXNode creates a new SSHX node configuration.
func PrintContainerInspect ¶ added in v0.70.0
func PrintContainerInspect(containers []clabruntime.GenericContainer, o *Options) error
PrintContainerInspect handles non-details output (table or grouped JSON summary).
func SignalHandledContext ¶ added in v0.69.1
func SignalHandledContext() (context.Context, context.CancelFunc)
SignalHandledContext returns a context that will be canceled if a SIGINT or SIGTERM is received.
Types ¶
type APIServerListItem ¶ added in v0.68.0
type APIServerListItem struct {
Name string `json:"name"`
State string `json:"state"`
Host string `json:"host"`
Port int `json:"port"`
LabsDir string `json:"labs_dir"`
Runtime string `json:"runtime"`
Owner string `json:"owner"`
}
APIServerListItem defines the structure for API server container info in JSON output.
type APIServerNode ¶ added in v0.68.0
type APIServerNode struct {
// contains filtered or unexported fields
}
APIServerNode implements runtime.Node interface for API server containers.
func NewAPIServerNode ¶ added in v0.68.0
func NewAPIServerNode(name, image, labsDir string, runtime clabruntime.ContainerRuntime, env map[string]string, labels map[string]string, ) (*APIServerNode, error)
func (*APIServerNode) Config ¶ added in v0.68.0
func (n *APIServerNode) Config() *clabtypes.NodeConfig
func (*APIServerNode) GetEndpoints ¶ added in v0.68.0
func (*APIServerNode) GetEndpoints() []clablinks.Endpoint
GetEndpoints implementation for the Node interface.
type ConfigOptions ¶ added in v0.70.0
type ConfigOptions struct {
TemplateVarOnly bool
}
type DeployOptions ¶ added in v0.70.0
type DeployOptions struct {
GenerateGraph bool
ManagementNetworkName string
ManagementIPv4Subnet net.IPNet
ManagementIPv6Subnet net.IPNet
Reconfigure bool
MaxWorkers uint
SkipPostDeploy bool
SkipLabDirectoryFileACLs bool
ExportTemplate string
LabOwner string
RestoreAll string
RestoreNodeSnapshots []string
}
type DestroyOptions ¶ added in v0.70.0
type EventsOptions ¶ added in v0.72.0
type ExecOptions ¶ added in v0.70.0
type FilterOptions ¶ added in v0.70.0
type GlobalOptions ¶ added in v0.70.0
type GlobalOptions struct {
TopologyFile string
VarsFile string
TopologyName string
Timeout time.Duration
Runtime string
GracefulShutdown bool
LogLevel string
DebugCount int
// special flag that should only be set by deploy, informs the context handler to destroy
// (or not) when root context is canceled
CleanOnCancel bool
// special flag that is only set on deploy,
// if true, the topology file backup is created at /tmp/.clab/bak
BackupTopologyFile bool
}
type GoTTYListItem ¶ added in v0.69.0
type GoTTYListItem struct {
Name string `json:"name"`
Network string `json:"network"`
State string `json:"state"`
IPv4Address string `json:"ipv4_address"`
Port uint `json:"port"`
WebURL string `json:"web_url"`
Owner string `json:"owner"`
}
GoTTYListItem defines the structure for GoTTY container info in JSON output.
type GraphOptions ¶ added in v0.70.0
type InspectOptions ¶ added in v0.70.0
type Manager ¶ added in v0.70.0
type Manager interface {
GetLatestVersion(ctx context.Context) *gover.Version
DisplayNewVersionAvailable(ctx context.Context, printCurrentVersion bool)
}
Manager is the config manager interface defining the version manager methods.
type Options ¶ added in v0.70.0
type Options struct {
Global *GlobalOptions
Filter *FilterOptions
Deploy *DeployOptions
Destroy *DestroyOptions
Config *ConfigOptions
Exec *ExecOptions
Inspect *InspectOptions
Graph *GraphOptions
Events *EventsOptions
ToolsAPI *ToolsApiOptions
ToolsCert *ToolsCertOptions
ToolsTxOffload *ToolsDisableTxOffloadOptions
ToolsGoTTY *ToolsGoTTYOptions
ToolsNetem *ToolsNetemOptions
ToolsSSHX *ToolsSSHXOptions
ToolsVeth *ToolsVethOptions
ToolsVxlan *ToolsVxlanOptions
ToolsSnapshot *ToolsSnapshotOptions
Version *VersionOptions
}
func GetOptions ¶ added in v0.70.0
func GetOptions() *Options
GetOptions returns the global options instance if it exists or creates a new one with default values for all options.
func (*Options) ToClabDestroyOptions ¶ added in v0.70.0
func (o *Options) ToClabDestroyOptions() []clabcore.DestroyOption
func (*Options) ToClabOptions ¶ added in v0.70.0
func (o *Options) ToClabOptions() []clabcore.ClabOption
type SSHXListItem ¶ added in v0.68.0
type SSHXListItem struct {
Name string `json:"name"`
Network string `json:"network"`
State string `json:"state"`
IPv4Address string `json:"ipv4_address"`
Link string `json:"link"`
Owner string `json:"owner"`
}
SSHXListItem defines the structure for SSHX container info in JSON output.
type SnapshotCollection ¶ added in v0.72.0
type SnapshotCollection struct {
// contains filtered or unexported fields
}
SnapshotCollection aggregates results from multiple node snapshot operations.
func NewSnapshotCollection ¶ added in v0.72.0
func NewSnapshotCollection() *SnapshotCollection
NewSnapshotCollection creates a new snapshot collection.
func (*SnapshotCollection) Add ¶ added in v0.72.0
func (sc *SnapshotCollection) Add(result *SnapshotResult)
Add adds a snapshot result to the collection.
func (*SnapshotCollection) Summary ¶ added in v0.72.0
func (sc *SnapshotCollection) Summary() string
Summary returns a summary string of the snapshot operations.
type SnapshotResult ¶ added in v0.72.0
type SnapshotResult struct {
NodeName string
Status string // "success", "failed", "skipped"
SnapshotPath string
SizeBytes int64
Duration time.Duration
Error error
Reason string
}
SnapshotResult represents the result of a snapshot operation for one node.
type ToolsApiOptions ¶ added in v0.70.0
type ToolsApiOptions struct {
Image string
Name string
Port uint
Host string
LabsDirectory string
JWTSecret string
JWTExpiration string
UserGroup string
SuperUserGroup string
LogLevel string
GinMode string
TrustedProxies string
TLSEnable bool
TLSCertFile string
TLSKeyFile string
SSHBasePort uint
SSHMaxPort uint
Owner string
OutputFormat string
}
type ToolsCertOptions ¶ added in v0.70.0
type ToolsDisableTxOffloadOptions ¶ added in v0.70.0
type ToolsDisableTxOffloadOptions struct {
ContainerName string
}
type ToolsGoTTYOptions ¶ added in v0.70.0
type ToolsNetemOptions ¶ added in v0.70.0
type ToolsSSHXOptions ¶ added in v0.70.0
type ToolsSnapshotOptions ¶ added in v0.72.0
type ToolsVethOptions ¶ added in v0.70.0
type ToolsVxlanOptions ¶ added in v0.70.0
type VersionOptions ¶ added in v0.70.0
Source Files
¶
- completion.go
- config.go
- context.go
- deploy.go
- destroy.go
- events.go
- exec.go
- generate.go
- graph.go
- inspect.go
- inspect_interfaces.go
- options.go
- redeploy.go
- root.go
- save.go
- tools.go
- tools_api.go
- tools_api_start.go
- tools_api_status.go
- tools_api_stop.go
- tools_cert.go
- tools_disableTxOffload.go
- tools_gotty.go
- tools_netem.go
- tools_snapshot.go
- tools_sshx.go
- tools_veth.go
- tools_vxlan.go
- version.go
- version_manager.go
- viper.go