ucind

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 23 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) 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.

Jump to

Keyboard shortcuts

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