handler

package
v0.0.0-...-980b4e3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConsoleCtxKey = "console command"

ConsoleCtxKey is a context key for commands invoked in an interactive console.

View Source
var ErrorColor = color.New(color.FgRed)

ErrorColor is a customizable red color printer.

View Source
var InvalidImageSize = errors.New("invalid image size")

InvalidImageSize is an error about an invalid image size (size must be positive).

View Source
var InvalidRAMSize = errors.New("invalid ram size")

InvalidRAMSize is an error about an invalid RAM memory size (size must be positive).

View Source
var NoOpenWebSocket = errors.New("no open websocket found")

NoOpenWebSocket is an error about an opened WebSocket not being found in a virtual machine's VNC servers.

View Source
var PrintSuccess = SuccessColor.PrintfFunc()

PrintSuccess is a Printf-compatible func for SuccessColor.

View Source
var RecursiveConsoleError = errors.New("the console command cannot be invoked inside of itself")

RecursiveConsoleError is an error which gets raised when a user attempts to invoke the console command in a console.

View Source
var SuccessColor = color.New(color.FgGreen)

SuccessColor is a customizable green color printer.

View Source
var UnknownArchitecture = errors.New("unknown architecture")

UnknownArchitecture is an error about an unknown architecture.

View Source
var UnknownFormat = errors.New("unknown format")

UnknownFormat is an error about a missing image format.

View Source
var UnknownPowerAction = errors.New("unknown power action")

UnknownPowerAction is an error about an unknown power action.

Functions

func AttachImage

func AttachImage(cCtx *cli.Context) error

AttachImage is a handler for the "vm attach" command.

func ClearImageMetadata

func ClearImageMetadata(cCtx *cli.Context) error

ClearImageMetadata is a handler for the "image metadata clear" command.

func ClearVmMetadata

func ClearVmMetadata(cCtx *cli.Context) error

ClearVmMetadata is a handler for the "vm metadata clear" command.

func Console

func Console(cCtx *cli.Context) error

Console is a handler for the "console" command.

func CreateImage

func CreateImage(cCtx *cli.Context) error

CreateImage is a handler for the "image create" command.

func CreateVirtualMachine

func CreateVirtualMachine(cCtx *cli.Context) error

CreateVirtualMachine is a handler for the "vm create" command.

func DeleteImage

func DeleteImage(cCtx *cli.Context) error

DeleteImage is a handler for the "image delete" command.

func DeleteVirtualMachine

func DeleteVirtualMachine(cCtx *cli.Context) error

DeleteVirtualMachine is a handler for the "vm delete" command.

func DetachImage

func DetachImage(cCtx *cli.Context) error

DetachImage is a handler for the "vm detach" command.

func GetImageMetadata

func GetImageMetadata(cCtx *cli.Context) error

GetImageMetadata is a handler for the "image metadata" command.

func GetMetadataFunc

func GetMetadataFunc(registry MetadatableRegistry) func(cCtx *cli.Context) error

GetMetadataFunc produces a handler for "metadata" commands.

func GetStatus

func GetStatus(cCtx *cli.Context) error

GetStatus is a handler for the "vm status" command.

func GetVmMetadata

func GetVmMetadata(cCtx *cli.Context) error

GetVmMetadata is a handler for the "vm metadata" command.

func Images

func Images(cCtx *cli.Context) error

Images is a handler for the "vm images" command.

func ListImages

func ListImages(cCtx *cli.Context) error

ListImages is a handler for the "image list" command.

func ListVirtualMachines

func ListVirtualMachines(cCtx *cli.Context) error

ListVirtualMachines is a handler for the "vm list" command.

func Power

func Power(cCtx *cli.Context) error

Power is a handler for the "vm power" command.

func PrintError

func PrintError(format string, a ...interface{})

PrintError is a Printf-compatible func for ErrorColor.

func SetImageMetadata

func SetImageMetadata(cCtx *cli.Context) error

SetImageMetadata is a handler for the "image metadata set" command.

func SetMetadataFunc

func SetMetadataFunc(registry MetadatableRegistry) func(cCtx *cli.Context) error

SetMetadataFunc produces a handler for "metadata set" commands.

func SetVmMetadata

func SetVmMetadata(cCtx *cli.Context) error

SetVmMetadata is a handler for the "vm metadata set" command.

func VNC

func VNC(cCtx *cli.Context) error

VNC is a handler for the "vm vnc" command.

Types

type MetadatableRegistry

type MetadatableRegistry interface {
	GetMetadata(ctx context.Context, in *v1.GetMetadataRequest, opts ...grpc.CallOption) (*v1.GetMetadataResponse, error)
	SetMetadata(ctx context.Context, in *v1.SetMetadataRequest, opts ...grpc.CallOption) (*v1.SetMetadataResponse, error)
}

MetadatableRegistry is a registry that allows for CRUD operations with metadata.

Jump to

Keyboard shortcuts

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