config

package
v0.12.7 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(force bool) error

func NewConfigCmd

func NewConfigCmd(configRef *ConfigRef) *cobra.Command

Types

type BoxConfig

type BoxConfig struct {
	Provider string `yaml:"provider"`
	Size     string `yaml:"size"`
}

type CloudConfig

type CloudConfig struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Username string `yaml:"username"`
	Token    string `yaml:"token"`
}

func (*CloudConfig) ToCloudOptions added in v0.9.0

func (c *CloudConfig) ToCloudOptions(version string) *commonModel.CloudOptions

type CommonConfig added in v0.11.0

type CommonConfig struct {
	ShareDir string `yaml:"shareDir"`
}

func (*CommonConfig) ToShareDirInfo added in v0.12.0

func (c *CommonConfig) ToShareDirInfo(lockDir bool) *commonModel.ShareDirInfo

type ConfigRef

type ConfigRef struct {
	Config *ConfigV1
}

ConfigRef is a wrapper used to avoid global variables. It's used to reference the config value in the commands before they are actually loaded with viper in each PersistentPreRunE.

type ConfigV1

type ConfigV1 struct {
	Kind     string         `yaml:"kind"`
	Version  string         `yaml:"version"`
	Log      LogConfig      `yaml:"log"`
	Provider ProviderConfig `yaml:"provider"`
	Network  NetworkConfig  `yaml:"network"`
	Template TemplateConfig `yaml:"template"`
	Common   CommonConfig   `yaml:"common"`
	Box      BoxConfig      `yaml:"box"`
	Task     TaskConfig     `yaml:"task"`
}

func LoadConfig

func LoadConfig() (*ConfigV1, error)

type DockerConfig

type DockerConfig struct {
	NetworkName string `yaml:"networkName"`
}

func (*DockerConfig) ToDockerOptions added in v0.9.0

func (c *DockerConfig) ToDockerOptions() *commonModel.DockerOptions

type KubeConfig

type KubeConfig struct {
	ConfigPath string `yaml:"configPath"`
	Namespace  string `yaml:"namespace"`
}

func (*KubeConfig) ToKubeOptions added in v0.9.0

func (c *KubeConfig) ToKubeOptions() *commonModel.KubeOptions

type LogConfig

type LogConfig struct {
	Level    string `yaml:"level"`
	FilePath string `yaml:"filePath"`
}

type NetworkConfig added in v0.9.0

type NetworkConfig struct {
	Privileged bool        `yaml:"privileged"`
	Vpn        []VpnConfig `yaml:"vpn"`
}

func (*NetworkConfig) ToNetworkVpnInfo added in v0.12.0

func (c *NetworkConfig) ToNetworkVpnInfo(vpnName string) (*commonModel.NetworkVpnInfo, error)

func (*NetworkConfig) VpnNetworks added in v0.10.0

func (c *NetworkConfig) VpnNetworks() map[string]commonModel.NetworkVpnInfo

type ProviderConfig

type ProviderConfig struct {
	Docker DockerConfig `yaml:"docker"`
	Kube   KubeConfig   `yaml:"kube"`
	Cloud  CloudConfig  `yaml:"cloud"`
}

type TaskConfig added in v0.10.0

type TaskConfig struct {
	Provider string `yaml:"provider"`
	LogDir   string `yaml:"logDir"`
}

type TemplateConfig

type TemplateConfig struct {
	Revision string `yaml:"revision"`
	CacheDir string `yaml:"cacheDir"`
}

type VpnConfig added in v0.9.0

type VpnConfig struct {
	Name string `yaml:"name"`
	Path string `yaml:"path"`
}

Jump to

Keyboard shortcuts

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