Documentation
¶
Index ¶
- func AddFormatFlag(cmd *cobra.Command)
- func AddOutputFlag(cmd *cobra.Command)
- func CloneVMConfigFromFlags(cmd *cobra.Command, snapCfg types.SnapshotConfig) (*types.VMConfig, error)
- func CloseOnCancel(ctx context.Context, c io.Closer) func() bool
- func CommandContext(cmd *cobra.Command) context.Context
- func EnsureFirmwarePath(conf *config.Config, bootCfg *types.BootConfig)
- func EnsureImage(ctx context.Context, backends []imagebackend.Images, vmCfg *types.VMConfig)
- func FindHypervisor(ctx context.Context, conf *config.Config, ref string) (hypervisor.Hypervisor, error)
- func FormatSize(bytes int64) string
- func InitAllHypervisors(ctx context.Context, conf *config.Config) ([]hypervisor.Hypervisor, error)
- func InitBackends(ctx context.Context, conf *config.Config) ([]imagebackend.Images, hypervisor.Hypervisor, error)
- func InitBridgeNetwork(conf *config.Config, bridgeDev string) (network.Network, error)
- func InitHypervisor(ctx context.Context, conf *config.Config) (hypervisor.Hypervisor, error)
- func InitImageBackends(ctx context.Context, conf *config.Config) ([]imagebackend.Images, error)
- func InitImageBackendsForPull(ctx context.Context, conf *config.Config) (*oci.OCI, *cloudimg.CloudImg, error)
- func InitNetwork(conf *config.Config) (network.Network, error)
- func InitSnapshot(ctx context.Context, conf *config.Config, opts ...localfile.Option) (snapshot.Snapshot, error)
- func IsURL(ref string) bool
- func ListAllVMs(ctx context.Context, hypers []hypervisor.Hypervisor) ([]*types.VM, error)
- func MaybeOutputJSON(cmd *cobra.Command, v any) (bool, error)
- func MeteringRecorder(ctx context.Context, conf *config.Config) metering.Recorder
- func OutputFormatted(cmd *cobra.Command, data any, tableFn func(w *tabwriter.Writer)) error
- func OutputJSON(v any) error
- func ReconcileState(vm *types.VM) string
- func ResolveImage(ctx context.Context, backends []imagebackend.Images, vmCfg *types.VMConfig) ([]*types.StorageConfig, *types.BootConfig, error)
- func ResolveImageOwner(ctx context.Context, backends []imagebackend.Images, ref string) (imagebackend.Images, error)
- func RestoreVMConfigFromFlags(cmd *cobra.Command, vm *types.VM, snapCfg types.SnapshotConfig) (*types.VMConfig, error)
- func RouteRefs(ctx context.Context, hypers []hypervisor.Hypervisor, refs []string) (map[hypervisor.Hypervisor][]string, error)
- func VMConfigFromFlags(cmd *cobra.Command, image string) (*types.VMConfig, error)
- func WantJSON(cmd *cobra.Command) bool
- type BaseHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFormatFlag ¶
func AddOutputFlag ¶ added in v0.3.7
func CloneVMConfigFromFlags ¶
func CloseOnCancel ¶ added in v0.4.1
CloseOnCancel closes c when ctx is canceled; callers `defer CloseOnCancel(ctx, c)()` to stop the watcher on return.
func EnsureFirmwarePath ¶
func EnsureFirmwarePath(conf *config.Config, bootCfg *types.BootConfig)
func EnsureImage ¶ added in v0.3.6
EnsureImage pulls the digest-pinned base if missing; only warns so VerifyBaseFiles surfaces the real error for imported images.
func FindHypervisor ¶ added in v0.2.9
func FindHypervisor(ctx context.Context, conf *config.Config, ref string) (hypervisor.Hypervisor, error)
func FormatSize ¶
func InitAllHypervisors ¶ added in v0.2.9
func InitAllHypervisors(ctx context.Context, conf *config.Config) ([]hypervisor.Hypervisor, error)
func InitBackends ¶
func InitBackends(ctx context.Context, conf *config.Config) ([]imagebackend.Images, hypervisor.Hypervisor, error)
func InitBridgeNetwork ¶ added in v0.3.2
func InitHypervisor ¶
func InitHypervisor(ctx context.Context, conf *config.Config) (hypervisor.Hypervisor, error)
func InitImageBackends ¶
func InitSnapshot ¶
func ListAllVMs ¶ added in v0.2.9
func ListAllVMs(ctx context.Context, hypers []hypervisor.Hypervisor) ([]*types.VM, error)
func MaybeOutputJSON ¶ added in v0.3.7
MaybeOutputJSON emits JSON iff --output=json; (true, _) means caller should stop logging.
func MeteringRecorder ¶ added in v0.4.1
MeteringRecorder returns the process-wide recorder per conf.Metering.Backend; lazy-init shared across callers.
func OutputFormatted ¶
func OutputJSON ¶
func ReconcileState ¶
func ResolveImage ¶
func ResolveImage(ctx context.Context, backends []imagebackend.Images, vmCfg *types.VMConfig) ([]*types.StorageConfig, *types.BootConfig, error)
func ResolveImageOwner ¶ added in v0.3.1
func ResolveImageOwner(ctx context.Context, backends []imagebackend.Images, ref string) (imagebackend.Images, error)
func RestoreVMConfigFromFlags ¶
func RestoreVMConfigFromFlags(cmd *cobra.Command, vm *types.VM, snapCfg types.SnapshotConfig) (*types.VMConfig, error)
RestoreVMConfigFromFlags builds VMConfig for restore: resources from the snapshot, Name/Network from the VM (CNI namespace survives restore).
func RouteRefs ¶ added in v0.2.9
func RouteRefs(ctx context.Context, hypers []hypervisor.Hypervisor, refs []string) (map[hypervisor.Hypervisor][]string, error)
RouteRefs resolves user refs to (hypervisor → full VM IDs).
func VMConfigFromFlags ¶
Types ¶
type BaseHandler ¶
func NewBaseHandler ¶
func NewBaseHandler(conf *config.Config) BaseHandler
Click to show internal directories.
Click to hide internal directories.