Versions in this module Expand all Collapse all v0 v0.4.0 Oct 11, 2026 Changes in this version + const UnknownExitCode + var ErrAlreadyExists = errors.New("already exists") + var ErrFailedPrecondition = errors.New("failed precondition") + var ErrInvalidArgument = errors.New("invalid argument") + var ErrNotFound = errors.New("not found") + var ErrPermissionDenied = errors.New("permission denied") + var ErrResourceExhausted = errors.New("resource exhausted") + var ErrUnauthenticated = errors.New("unauthenticated") + var ErrUnavailable = errors.New("unavailable") + var ErrUnimplemented = errors.New("unimplemented") + type Architecture string + const ArchitectureAArch64 + const ArchitectureX86_64 + type CheckHostOptions struct + KeepFailedTestInstance bool + TestInstance bool + TestInstanceHypervisor HypervisorType + TestInstanceHypervisorVersion string + TestInstanceImage string + TestInstanceTimeout time.Duration type Client + Images *Images + Instances *Instances + Kernels *Kernels + Networks *Networks + Snapshots *Snapshots + Tokens *Tokens + Volumes *Volumes + func (c *Client) CheckHost(ctx context.Context, opts CheckHostOptions, onResult func(HostCheckResult)) ([]HostCheckResult, error) + func (c *Client) Events(ctx context.Context, opts EventOptions) (*EventStream, error) + func (c *Client) HostInfo(ctx context.Context) (HostInfo, error) + func (c *Client) Resources(ctx context.Context) (Resources, error) + type Cmd struct + Args []string + Columns int + Dir string + Env map[string]string + Instance string + Rows int + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + TTY bool + Timeout time.Duration + User string + func (c *Cmd) Output(ctx context.Context) ([]byte, error) + func (c *Cmd) Resize(rows, columns int) error + func (c *Cmd) Run(ctx context.Context) error + func (c *Cmd) Start(ctx context.Context) error + func (c *Cmd) Wait() error + type CreateOptions struct + PullPolicy PullPolicy + Start bool + type DeleteOptions struct + Force bool + type DiskUsage struct + FreeBytes int64 + Path string + ProvisionedBytes int64 + TotalBytes int64 + type Event struct + Action EventAction + Attributes map[string]string + ID string + Kind EventKind + Message string + Name string + Time time.Time + type EventAction string + const EventActionCollected + const EventActionCreated + const EventActionDeleted + const EventActionDied + const EventActionExited + const EventActionHealthy + const EventActionImported + const EventActionPaused + const EventActionPulled + const EventActionRenamed + const EventActionResized + const EventActionRestarting + const EventActionResumed + const EventActionSnapshotRestored + const EventActionStandby + const EventActionStarted + const EventActionStopped + const EventActionUnhealthy + const EventActionUpdated + type EventBatch struct + CaughtUp bool + Events []Event + type EventKind string + const EventKindImage + const EventKindInstance + const EventKindKernel + const EventKindNetwork + const EventKindSnapshot + const EventKindVolume + type EventOptions struct + Follow bool + ID string + Kind EventKind + Limit int + Name string + Since time.Time + type EventStream struct + func (s *EventStream) Close() error + func (s *EventStream) Next() (EventBatch, error) + type ExitError struct + Code int + Stderr []byte + func (e *ExitError) Error() string + type ForkOptions struct + Name string + NetworkName string + Ports []PortMapping + StaticIP string + type HTTPProbe struct + Path string + Port int + type Health struct + Check HealthCheck + FailingStreak int + LastCheckTime time.Time + LastOutput string + Status HealthStatus + type HealthCheck struct + Disabled bool + Exec []string + HTTP *HTTPProbe + Interval time.Duration + Retries int + StartPeriod time.Duration + TCP *TCPProbe + Timeout time.Duration + func (c HealthCheck) Validate() error + type HealthStatus string + const HealthStatusHealthy + const HealthStatusStarting + const HealthStatusUnhealthy + type HostCheckGroup string + const HostCheckGroupHost + const HostCheckGroupInstances + type HostCheckResult struct + Console []string + Detail string + Group HostCheckGroup + Hint string + Name string + Status HostCheckStatus + type HostCheckStatus string + const HostCheckStatusFailed + const HostCheckStatusOK + const HostCheckStatusWarning + type HostInfo struct + Fingerprint string + Hostname string + Hypervisors []HypervisorInfo + ListenerAddresses []string + Token string + Version string + type HypervisorInfo struct + DeprecatedVersions []string + IsDefault bool + Type HypervisorType + Versions []string + type HypervisorType string + const HypervisorTypeCloudHypervisor + const HypervisorTypeFirecracker + type Image struct + CreateTime time.Time + Digest string + HealthCheck *HealthCheck + LastUsedTime time.Time + Name string + SizeBytes int64 + UpdateTime time.Time + type Images struct + func (s *Images) Delete(ctx context.Context, ref string, opts DeleteOptions) error + func (s *Images) Get(ctx context.Context, ref string) (Image, error) + func (s *Images) List(ctx context.Context) ([]Image, error) + func (s *Images) Prune(ctx context.Context) (PruneResult, error) + func (s *Images) Pull(ctx context.Context, ref string, onProgress func(PullProgress)) (Image, error) + type InitMode string + const InitModeAuto + const InitModeExec + const InitModeSystemd + type Instance struct + CreateTime time.Time + ExitCode *int + FinishTime time.Time + Health *Health + HypervisorPID int + ID string + IP string + ImageDigest string + MAC string + NextRestartTime time.Time + RestartCount int + StartTime time.Time + State InstanceState + StateError string + UpdateTime time.Time + VsockCID int64 + type InstanceResources struct + MemoryBytes int64 + Name string + State InstanceState + VCPUs int + type InstanceSpec struct + Cmd []string + DiskBytes int64 + DiskBytesPerSecond int64 + DiskIOPS int64 + DownloadBytesPerSecond int64 + Env map[string]string + HealthCheck *HealthCheck + Hostname string + HypervisorType HypervisorType + HypervisorVersion string + ImageRef string + InitMode InitMode + KernelArgs string + KernelName string + Labels map[string]string + MaxMemoryBytes int64 + MaxVCPUs int + MemoryBytes int64 + Mounts []Mount + Name string + NetworkName string + Ports []PortMapping + RemoveOnExit bool + RestartPolicy RestartPolicy + StandbyAfter time.Duration + StaticIP string + UploadBytesPerSecond int64 + User string + VCPUs int + type InstanceState string + const InstanceStateFailed + const InstanceStatePaused + const InstanceStateRestarting + const InstanceStateRunning + const InstanceStateStandby + const InstanceStateStarting + const InstanceStateStopped + const InstanceStateStopping + type InstanceStats struct + CPUPercent float64 + CPUTime time.Duration + DiskReadBytes int64 + DiskWrittenBytes int64 + ID string + MemoryBytes int64 + Name string + NetworkReceiveBytes int64 + NetworkReceiveDrops int64 + NetworkReceiveErrors int64 + NetworkReceivePackets int64 + NetworkTransmitBytes int64 + NetworkTransmitDrops int64 + NetworkTransmitErrors int64 + NetworkTransmitPackets int64 + ResidentMemoryBytes int64 + VCPUs int + type InstanceStatsBatch struct + Instances []InstanceStats + ReadTime time.Time + type InstanceStatsOptions struct + Follow bool + Names []string + type InstanceStatsStream struct + func (s *InstanceStatsStream) Close() error + func (s *InstanceStatsStream) Next() (InstanceStatsBatch, error) + type InstanceUpdate struct + Cmd []string + DiskBytes *int64 + DiskBytesPerSecond *int64 + DiskIOPS *int64 + DownloadBytesPerSecond *int64 + Env map[string]string + HealthCheck *HealthCheck + Hostname *string + HypervisorType HypervisorType + HypervisorVersion *string + InitMode InitMode + KernelArgs *string + KernelName *string + Labels map[string]string + MaxMemoryBytes *int64 + MaxVCPUs *int + MemoryBytes *int64 + Mounts []Mount + NetworkName *string + Ports []PortMapping + RemoveOnExit *bool + RestartPolicy *RestartPolicy + StandbyAfter *time.Duration + StaticIP *string + UploadBytesPerSecond *int64 + User *string + VCPUs *int + type Instances struct + func (s *Instances) Command(name string, args ...string) *Cmd + func (s *Instances) CopyArchiveFrom(ctx context.Context, name, src string) (io.ReadCloser, error) + func (s *Instances) CopyArchiveTo(ctx context.Context, name, dest string, r io.Reader) error + func (s *Instances) CopyFrom(ctx context.Context, name, src, dest string) error + func (s *Instances) CopyTo(ctx context.Context, name, src, dest string) error + func (s *Instances) Create(ctx context.Context, spec InstanceSpec, opts CreateOptions) (Instance, error) + func (s *Instances) Delete(ctx context.Context, name string, opts DeleteOptions) error + func (s *Instances) Fork(ctx context.Context, name string, opts ForkOptions) (Instance, error) + func (s *Instances) Get(ctx context.Context, name string) (Instance, error) + func (s *Instances) List(ctx context.Context) ([]Instance, error) + func (s *Instances) Logs(ctx context.Context, name string, opts LogOptions) (io.ReadCloser, error) + func (s *Instances) Pause(ctx context.Context, name string) (Instance, error) + func (s *Instances) Processes(ctx context.Context, name string) ([]Process, error) + func (s *Instances) ReadFile(ctx context.Context, name, file string) ([]byte, error) + func (s *Instances) Rename(ctx context.Context, name, newName string) (Instance, error) + func (s *Instances) Resize(ctx context.Context, name string, opts ResizeOptions) (Instance, error) + func (s *Instances) Resume(ctx context.Context, name string) (Instance, error) + func (s *Instances) Standby(ctx context.Context, name string) (Instance, error) + func (s *Instances) Start(ctx context.Context, name string) (Instance, error) + func (s *Instances) Stats(ctx context.Context, opts InstanceStatsOptions) (*InstanceStatsStream, error) + func (s *Instances) Stop(ctx context.Context, name string) (Instance, error) + func (s *Instances) Update(ctx context.Context, name string, update InstanceUpdate) (Instance, error) + func (s *Instances) Wait(ctx context.Context, name string, opts WaitOptions) (int, error) + func (s *Instances) Waiter(ctx context.Context, name string, opts WaitOptions) (*Waiter, error) + func (s *Instances) WriteFile(ctx context.Context, name, file string, data []byte, perm fs.FileMode) error + type IssuedToken struct + Value string + type Kernel struct + CreateTime time.Time + ID string + UpdateTime time.Time + type KernelSpec struct + Architecture Architecture + Name string + SHA256 string + type Kernels struct + func (s *Kernels) Delete(ctx context.Context, name string) error + func (s *Kernels) Get(ctx context.Context, name string) (Kernel, error) + func (s *Kernels) Import(ctx context.Context, spec KernelSpec, r io.Reader) (Kernel, error) + func (s *Kernels) List(ctx context.Context) ([]Kernel, error) + type LogOptions struct + Follow bool + Source LogSource + TailLines int + type LogSource string + const LogSourceGuest + const LogSourceHypervisor + type Mount struct + Content []byte + Mode fs.FileMode + ReadOnly bool + Source string + Target string + Type MountType + func FileMount(path, target string) (Mount, error) + type MountType string + const MountTypeDirectory + const MountTypeFile + const MountTypeTmpfs + const MountTypeVolume + type Network struct + Bridge string + CreateTime time.Time + FreeIPs int64 + ID string + TotalIPs int64 + UpdateTime time.Time + type NetworkAllocation struct + IP string + InstanceID string + InstanceName string + MAC string + TapDevice string + type NetworkSpec struct + Gateway string + Internal bool + Isolated bool + MTU int + Name string + Nameservers []string + Subnet string + type Networks struct + func (s *Networks) Allocations(ctx context.Context, name string) ([]NetworkAllocation, error) + func (s *Networks) Create(ctx context.Context, spec NetworkSpec) (Network, error) + func (s *Networks) Delete(ctx context.Context, name string) error + func (s *Networks) Get(ctx context.Context, name string) (Network, error) + func (s *Networks) List(ctx context.Context) ([]Network, error) type Option + func WithToken(value string) Option + type PortMapping struct + GuestPort int + HostIP string + HostPort int + Protocol Protocol + type Process struct + CPUTime time.Duration + Command []string + Name string + PID int + PPID int + ResidentMemoryBytes int64 + StartTime time.Time + State string + User string + type Protocol string + const ProtocolTCP + const ProtocolUDP + type PruneResult struct + Images []Image + ReclaimedBytes int64 + type PullPolicy string + const PullPolicyAlways + const PullPolicyMissing + const PullPolicyNever + type PullProgress struct + DownloadedBytes int64 + Stage PullStage + TotalBytes int64 + type PullStage string + const PullStageConverting + const PullStageDownloading + const PullStageResolving + const PullStageUnpacking + type ResizeOptions struct + MemoryBytes int64 + VCPUs int + type ResourceCapacity struct + Allocatable int64 + Allocated int64 + Available int64 + Host int64 + Overcommit float64 + Reserved int64 + type Resources struct + CPU ResourceCapacity + Disk DiskUsage + Instances []InstanceResources + Memory ResourceCapacity + type RestartMode string + const RestartModeAlways + const RestartModeNo + const RestartModeOnFailure + const RestartModeUnlessStopped + type RestartPolicy struct + MaxRetries int + Mode RestartMode + type Scope string + const ScopeAll + const ScopeEventsRead + const ScopeImagesRead + const ScopeImagesWrite + const ScopeInstancesRead + const ScopeInstancesWrite + const ScopeKernelsRead + const ScopeKernelsWrite + const ScopeNetworksRead + const ScopeNetworksWrite + const ScopeSnapshotsRead + const ScopeSnapshotsWrite + const ScopeTokensRead + const ScopeTokensWrite + const ScopeVolumesRead + const ScopeVolumesWrite + type Snapshot struct + CreateTime time.Time + HypervisorType HypervisorType + HypervisorVersion string + ID string + InstanceID string + InstanceName string + Kind SnapshotKind + MemoryBytes int64 + Name string + SizeBytes int64 + VCPUs int + type SnapshotKind string + const SnapshotKindDisk + const SnapshotKindMemory + type Snapshots struct + func (s *Snapshots) Create(ctx context.Context, instance, name string) (Snapshot, error) + func (s *Snapshots) Delete(ctx context.Context, name string) error + func (s *Snapshots) Fork(ctx context.Context, name string, opts ForkOptions) (Instance, error) + func (s *Snapshots) Get(ctx context.Context, name string) (Snapshot, error) + func (s *Snapshots) List(ctx context.Context, instance string) ([]Snapshot, error) + func (s *Snapshots) Restore(ctx context.Context, name string) (Instance, error) + type TCPProbe struct + Port int + type Token struct + CreateTime time.Time + ID string + LastUseTime time.Time + UpdateTime time.Time + type TokenSpec struct + Name string + Scopes []Scope + Secret string + type Tokens struct + func (s *Tokens) Create(ctx context.Context, spec TokenSpec) (IssuedToken, error) + func (s *Tokens) Delete(ctx context.Context, name string) error + func (s *Tokens) Get(ctx context.Context, name string) (Token, error) + func (s *Tokens) List(ctx context.Context) ([]Token, error) + func (s *Tokens) Rotate(ctx context.Context, name, secret string) (IssuedToken, error) + type Volume struct + CreateTime time.Time + ID string + Name string + SizeBytes int64 + UpdateTime time.Time + type Volumes struct + func (s *Volumes) Create(ctx context.Context, name string, sizeBytes int64) (Volume, error) + func (s *Volumes) Delete(ctx context.Context, name string) error + func (s *Volumes) Get(ctx context.Context, name string) (Volume, error) + func (s *Volumes) List(ctx context.Context) ([]Volume, error) + type WaitCondition string + const WaitConditionHealthy + const WaitConditionStopped + type WaitOptions struct + Condition WaitCondition + ID string + NextStop bool + type Waiter struct + func (w *Waiter) Close() error + func (w *Waiter) Wait() (int, error) v0.3.0 Sep 30, 2026 Changes in this version + const DefaultKeepaliveInterval + const DefaultKeepaliveTimeout type Option + func WithKeepalive(interval, timeout time.Duration) Option v0.2.0 Sep 26, 2026 v0.1.0 Sep 26, 2026 Changes in this version + const DefaultAddress + type Client struct + func NewClient(opts ...Option) (*Client, error) + func (c *Client) Close() error + type Option func(*options) + func WithAddress(target string) Option + func WithDialOptions(opts ...grpc.DialOption) Option + func WithTLS(cfg *tls.Config) Option