ucind

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterNameLabel = "ucind.cluster.name"
	ManagedLabel     = "ucind.managed"
)
View Source
const (
	DefaultImage   = "ghcr.io/psviderski/ucind:latest"
	UncloudAPIPort = 51000

	MachineNameLabel = "ucind.machine.name"
)

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Name     string
	Machines []Machine
}

func (*Cluster) PopulateMachineIDs added in v0.6.0

func (c *Cluster) PopulateMachineIDs(ctx context.Context) error

type ConfigUpdater

type ConfigUpdater struct {
	// contains filtered or unexported fields
}

func NewConfigUpdater

func NewConfigUpdater(path string) *ConfigUpdater

func (*ConfigUpdater) AddCluster

func (u *ConfigUpdater) AddCluster(c Cluster) error

func (*ConfigUpdater) RemoveCluster

func (u *ConfigUpdater) RemoveCluster(name string) error

type CreateClusterOptions

type CreateClusterOptions struct {
	Machines int
	// Ports to forward from the cluster machines to the host.
	PortMap nat.PortMap
}

type CreateMachineOptions

type CreateMachineOptions struct {
	Name  string
	Image string
	// Ports to forward from the machine to the host.
	PortMap nat.PortMap
}

type Machine

type Machine struct {
	ClusterName   string
	ContainerName string
	ID            string
	Name          string
	APIAddress    netip.AddrPort
}

func (*Machine) Connect

func (m *Machine) Connect(ctx context.Context) (*client.Client, error)

type Provisioner

type Provisioner struct {
	// contains filtered or unexported fields
}

func NewProvisioner

func NewProvisioner(cli *client.Client, configUpdater *ConfigUpdater) *Provisioner

func (*Provisioner) CreateCluster

func (p *Provisioner) CreateCluster(ctx context.Context, name string, opts CreateClusterOptions) (Cluster, error)

func (*Provisioner) CreateMachine

func (p *Provisioner) CreateMachine(ctx context.Context, clusterName string, opts CreateMachineOptions) (Machine, error)

func (*Provisioner) InspectCluster

func (p *Provisioner) InspectCluster(ctx context.Context, name string) (Cluster, error)

func (*Provisioner) ListClusters added in v0.19.0

func (p *Provisioner) ListClusters(ctx context.Context) ([]Cluster, error)

func (*Provisioner) RemoveCluster

func (p *Provisioner) RemoveCluster(ctx context.Context, name string) error

func (*Provisioner) WaitClusterReady

func (p *Provisioner) WaitClusterReady(ctx context.Context, c Cluster, timeout time.Duration) error

WaitClusterReady waits for all machines in the cluster to be ready and UP.

Directories

Path Synopsis
Package completion implements completion functions for the ucind cli.
Package completion implements completion functions for the ucind cli.

Jump to

Keyboard shortcuts

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