config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: GPL-3.0 Imports: 18 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"`
}

TODO add restart flag

type CloudConfig

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

func (*CloudConfig) ToCloudBoxOptions

func (c *CloudConfig) ToCloudBoxOptions(version string) *model.CloudBoxOptions

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"`
	Log      LogConfig      `yaml:"log"`
	Template TemplateConfig `yaml:"template"`
	Box      BoxConfig      `yaml:"box"`
	Provider ProviderConfig `yaml:"provider"`
}

func LoadConfig

func LoadConfig() (*ConfigV1, error)

type DockerConfig

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

func (*DockerConfig) ToDockerBoxOptions

func (c *DockerConfig) ToDockerBoxOptions() *model.DockerBoxOptions

type KubeConfig

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

func (*KubeConfig) ToKubeBoxOptions

func (c *KubeConfig) ToKubeBoxOptions() *model.KubeBoxOptions

type LogConfig

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

type ProviderConfig

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

type TemplateConfig

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

Jump to

Keyboard shortcuts

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