config

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSSHUser = "root"
	DefaultSSHPort = 22
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Name        string              `toml:"-"`
	Connections []MachineConnection `toml:"connections"`
}

type Config

type Config struct {
	Clusters       map[string]*Cluster `toml:"clusters"`
	CurrentCluster string              `toml:"current_cluster"`
	// contains filtered or unexported fields
}

func NewFromFile

func NewFromFile(path string) (*Config, error)

func (*Config) Read

func (c *Config) Read() error

func (*Config) Save

func (c *Config) Save() error

type MachineConnection

type MachineConnection struct {
	SSH        SSHDestination `toml:"ssh,omitempty"`
	SSHKeyFile string         `toml:"ssh_key_file,omitempty"`
	TCP        netip.AddrPort `toml:"tcp,omitempty"`
	Host       string         `toml:"host,omitempty"`
	PublicKey  secret.Secret  `toml:"public_key,omitempty"`
}

type SSHDestination

type SSHDestination string

SSHDestination represents an SSH destination string in the canonical form of "user@host:port". The default user "root" and port 22 can be omitted.

func NewSSHDestination

func NewSSHDestination(user, host string, port int) SSHDestination

func (SSHDestination) Parse

func (d SSHDestination) Parse() (user string, host string, port int, err error)

Jump to

Keyboard shortcuts

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