cli

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm() (bool, error)

Types

type CLI

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

func New

func New(configPath string, conn *config.MachineConnection) (*CLI, error)

New creates a new CLI instance with the given config path or remote machine connection. If the connection is provided, the config is ignored for all operations which is useful for interacting with a cluster without creating a config.

func (*CLI) AddMachine

func (cli *CLI) AddMachine(
	ctx context.Context, remoteMachine RemoteMachine, clusterName, machineName string, publicIP *netip.Addr,
) (*client.Client, error)

AddMachine provisions a remote machine and adds it to the cluster. It returns a client to interact with the machine which should be closed after use by the caller.

func (*CLI) ConnectCluster

func (cli *CLI) ConnectCluster(ctx context.Context, clusterName string) (*client.Client, error)

ConnectCluster connects to a cluster using the given cluster name or the current cluster if not specified. If the CLI was initialised with a machine connection, the config is ignored and the connection is used instead.

func (*CLI) CreateCluster

func (cli *CLI) CreateCluster(name string) error

func (*CLI) InitCluster

func (cli *CLI) InitCluster(
	ctx context.Context,
	remoteMachine *RemoteMachine,
	clusterName,
	machineName string,
	netPrefix netip.Prefix,
	publicIP *netip.Addr,
) (*client.Client, error)

InitCluster initialises a new cluster on a remote machine and returns a client to interact with the cluster. The client should be closed after use by the caller.

func (*CLI) ProgressOut

func (cli *CLI) ProgressOut() *streams.Out

ProgressOut returns an output stream for progress writer.

func (*CLI) SetCurrentCluster

func (cli *CLI) SetCurrentCluster(name string) error

type RemoteMachine

type RemoteMachine struct {
	User    string
	Host    string
	Port    int
	KeyPath string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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