common

import "github.com/analog-substance/carbon/pkg/common"

Index

Constants

const DefaultDeploymentsDirName = "deployments"

const DefaultImagesDirName = "images"

const DefaultInstanceConfigKey = "instance"

const DefaultInstanceDir = "."

const DefaultPackerDirName = "packer"

const DefaultProjectsDirName = "projects"

const DefaultTerraformDirName = "terraform"

const DeploymentsConfigKey = "deployments"

const ImagesConfigKey = "images"

const PackerConfigKey = "packer"

const TerraformConfigKey = "terraform"

const TerraformProjectConfigKey = "projects"

func Get

func Get(s string) any

func ImagesDir

func ImagesDir() string

func Keys

func Keys() []string

func LogLevel

func LogLevel(level slog.Level)

func Logger

func Logger() *slog.Logger

func PackerDir

func PackerDir() string

func ProjectsDir

func ProjectsDir() string

func Set

func Set(s string, v any) any

func SetProvidersTypes

func SetProvidersTypes(p []string)

func Time

func Time(what string) func()

func WithGroup

func WithGroup(groupName string) *slog.Logger

type CarbonConfig

type CarbonConfig struct {
    Dir       map[string]string         `yaml:"dir"`
    Providers map[string]ProviderConfig `yaml:"providers"`
}

func (*CarbonConfig) Get

func (cc *CarbonConfig) Get(search []string) any

func (*CarbonConfig) Keys

func (cc *CarbonConfig) Keys(prefix string) []string

func (*CarbonConfig) Set

func (cc *CarbonConfig) Set(search []string, val any) *CarbonConfig

type CarbonConfigFile

type CarbonConfigFile struct {
    Carbon CarbonConfig `yaml:"carbon"`
}

func GetConfig

func GetConfig() *CarbonConfigFile

func (*CarbonConfigFile) Get

func (cf *CarbonConfigFile) Get(search []string) any

func (*CarbonConfigFile) Keys

func (cf *CarbonConfigFile) Keys() []string

func (*CarbonConfigFile) MergeInConfigFile

func (cf *CarbonConfigFile) MergeInConfigFile(cfgFile string) error

func (*CarbonConfigFile) Set

func (cf *CarbonConfigFile) Set(search []string, val any) *CarbonConfigFile

type ProfileConfig

type ProfileConfig struct {
    Enabled         bool            `yaml:"enabled"`
    Username        string          `yaml:"username" `
    Password        string          `yaml:"password" `
    PasswordCommand string          `yaml:"password_command"`
    Use1PassCLI     bool            `yaml:"use_1pass_cli" `
    URL             string          `yaml:"url"`
    Environments    map[string]bool `yaml:"environments"`
}

func DefaultProfileConfig

func DefaultProfileConfig() ProfileConfig

func (*ProfileConfig) Get

func (pc *ProfileConfig) Get(search []string) any

func (*ProfileConfig) GetPassword

func (pc *ProfileConfig) GetPassword() string

func (*ProfileConfig) Keys

func (pc *ProfileConfig) Keys(prefix string) []string

func (*ProfileConfig) Set

func (pc *ProfileConfig) Set(search []string, val any) *ProfileConfig

func (*ProfileConfig) UnmarshalYAML

func (pc *ProfileConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

type ProviderConfig

type ProviderConfig struct {
    Enabled      bool                     `yaml:"enabled"`
    AutoDiscover bool                     `yaml:"auto_discover"`
    Profiles     map[string]ProfileConfig `yaml:"profiles"`
}

func DefaultProviderConfig

func DefaultProviderConfig() ProviderConfig

func (*ProviderConfig) Get

func (pc *ProviderConfig) Get(search []string) any

func (*ProviderConfig) Keys

func (pc *ProviderConfig) Keys(prefix string) []string

func (*ProviderConfig) Set

func (pc *ProviderConfig) Set(search []string, val any) *ProviderConfig

func (*ProviderConfig) UnmarshalYAML

func (pc *ProviderConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
Last modified March 27, 2025: Add GCP Support (#88) (dccf344)