config

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const AppName = "colima"

Variables

This section is empty.

Functions

func CacheDir

func CacheDir() string

CacheDir returns the cache directory.

func Dir

func Dir() string

Dir returns the configuration directory.

func Save

func Save(c Config) error

Save saves the config.

func SetProfile

func SetProfile(profileName string)

SetProfile sets the profile name for the application. This is an avenue to test Colima without breaking an existing stable setup. Not perfect, but good enough for testing.

func Teardown

func Teardown() error

Teardown deletes the config.

Types

type Config

type Config struct {
	// Virtual Machine
	VM VM `yaml:"vm"`

	// Runtime is one of docker, containerd.
	Runtime string `yaml:"runtime"`

	// Kubernetes sets if kubernetes should be enabled.
	Kubernetes Kubernetes `yaml:"kubernetes"`

	// Network address to forward VM ports to.
	PortInterface net.IP `yaml:"port_interface"`
}

Config is the application config.

func Load

func Load() (Config, error)

Load loads the config. Error is only returned if the config file exists but could not be loaded. No error is returned if the config file does not exist.

func (Config) Empty

func (c Config) Empty() bool

Empty checks if the configuration is empty.

type Kubernetes

type Kubernetes struct {
	Enabled bool   `yaml:"enabled"`
	Version string `yaml:"version"`
}

Kubernetes is kubernetes configuration

type ProfileInfo added in v0.3.0

type ProfileInfo struct {
	ID          string
	DisplayName string
}

ProfileInfo is information about the colima profile.

func Profile

func Profile() ProfileInfo

Profile returns the current application profile.

type VM

type VM struct {
	CPU    int    `yaml:"cpu"`
	Disk   int    `yaml:"disk"`
	Memory int    `yaml:"memory"`
	Arch   string `yaml:"arch"`

	// auto generated
	SSHPort      int  `yaml:"-"`
	ForwardAgent bool `yaml:"forward_agent"`

	// volume mounts
	Mounts []string `yaml:"mounts"`

	// do not persist. i.e. discarded on VM shutdown
	DNS []net.IP          `yaml:"-"` // DNS nameservers
	Env map[string]string `yaml:"-"` // environment variables
}

VM is virtual machine configuration.

type VersionInfo

type VersionInfo struct {
	Version  string
	Revision string
}

VersionInfo is the application version info.

func AppVersion

func AppVersion() VersionInfo

Jump to

Keyboard shortcuts

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