config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigKeys = []ConfigKey{
	{"api.url", "api.base_url", defaultAPIBaseURL},
	{"api.timeout", "api.timeout", "30s"},
	{"service", "service_name", "initiat-cli"},
	{"org", "project.default_org", ""},
	{"project", "project.default_project", ""},
}

Functions

func ClearDefaultOrgSlug

func ClearDefaultOrgSlug() error

func ClearDefaultProjectSlug added in v0.4.0

func ClearDefaultProjectSlug() error

func EnsureConfigFileExists

func EnsureConfigFileExists() error

func GetAPIBaseURL

func GetAPIBaseURL() string

GetAPIBaseURL returns the configured API base URL for production builds

func GetAPITimeout

func GetAPITimeout() string

func GetAlias

func GetAlias(alias string) string

func GetAllConfigKeys

func GetAllConfigKeys() []string

func GetDefaultOrgSlug

func GetDefaultOrgSlug() string

func GetDefaultProjectSlug added in v0.4.0

func GetDefaultProjectSlug() string

func GetServiceName

func GetServiceName() string

func InitConfig

func InitConfig() error

func IsValidConfigKey

func IsValidConfigKey(simplified string) bool

func ListAliases

func ListAliases() map[string]string

func MapSimplifiedKey

func MapSimplifiedKey(simplified string) string

func RemoveAlias

func RemoveAlias(alias string) error

func ResetToDefaults added in v0.4.0

func ResetToDefaults() error

func Save

func Save() error

func Set

func Set(key string, value interface{}) error

func SetAlias

func SetAlias(alias, projectPath string) error

func SetDefaultOrgSlug

func SetDefaultOrgSlug(orgSlug string) error

func SetDefaultProjectSlug added in v0.4.0

func SetDefaultProjectSlug(projectSlug string) error

Types

type APIConfig

type APIConfig struct {
	BaseURL string `mapstructure:"base_url"`
	Timeout string `mapstructure:"timeout"`
}

type Config

type Config struct {
	API         APIConfig         `mapstructure:"api"`
	Project     ProjectConfig     `mapstructure:"project"`
	Aliases     map[string]string `mapstructure:"aliases"`
	ServiceName string            `mapstructure:"service_name"`
}

func DefaultConfig

func DefaultConfig() *Config

func Get

func Get() *Config

type ConfigKey

type ConfigKey struct {
	Simplified string
	Actual     string
	Default    interface{}
}

func FindConfigKey

func FindConfigKey(simplified string) *ConfigKey

type LocalConfig added in v0.5.0

type LocalConfig struct {
	Org     string `yaml:"org"`
	Project string `yaml:"project"`
}

func FindLocalConfig added in v0.5.0

func FindLocalConfig() (*LocalConfig, error)

type ProjectConfig added in v0.4.0

type ProjectConfig struct {
	DefaultOrg     string `mapstructure:"default_org"`
	DefaultProject string `mapstructure:"default_project"`
}

type ProjectContext added in v0.4.0

type ProjectContext struct {
	OrgSlug     string
	ProjectSlug string
}

func ResolveProjectContext added in v0.4.0

func ResolveProjectContext(projectPath, org, project string) (*ProjectContext, error)

func (ProjectContext) String added in v0.4.0

func (w ProjectContext) String() string

Jump to

Keyboard shortcuts

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