Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEnvDoesNotExist is returned when an environment that does not exist in the config is requested ErrEnvDoesNotExist = errors.New("environment does not exist in this environments list") // ErrEnvNotDefined is returned if the environment was found but had no config, this usually means poor conf ErrEnvNotDefined = errors.New("environment was found but not defined") // ErrNoEnvironmentsDefined is returned when trying to save an empty config ErrNoEnvironmentsDefined = errors.New("no environments defined, nothing to write") // ErrInvalidEnvironmentName is returned if an environment is trying to be set with a blank name ErrInvalidEnvironmentName = errors.New("environment name cannot be blank") )
View Source
var Default = Env{
Name: "development",
}
Default is the default values for a environment
Functions ¶
func SourceVariables ¶ added in v1.0.0
SourceVariables will find the environment files for configuration and import their environment variables into the current running process
Types ¶
type Conf ¶
Conf is a map of configurations to their environment name.
func Load ¶
Load will read in the file from the configPath provided and then unmarshal the data into conf.
type Env ¶
type Env struct { Name string `yaml:"-" json:"-" env:"-"` Password string `yaml:"password,omitempty" json:"password,omitempty" env:"THEMEKIT_PASSWORD"` ThemeID string `yaml:"theme_id,omitempty" json:"theme_id,omitempty" env:"THEMEKIT_THEME_ID"` Domain string `yaml:"store" json:"store" env:"THEMEKIT_STORE"` Directory string `yaml:"directory,omitempty" json:"directory,omitempty" env:"THEMEKIT_DIRECTORY"` IgnoredFiles []string `yaml:"ignore_files,omitempty" json:"ignore_files,omitempty" env:"THEMEKIT_IGNORE_FILES" envSeparator:":"` Proxy string `yaml:"proxy,omitempty" json:"proxy,omitempty" env:"THEMEKIT_PROXY"` Ignores []string `yaml:"ignores,omitempty" json:"ignores,omitempty" env:"THEMEKIT_IGNORES" envSeparator:":"` Timeout time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty" env:"THEMEKIT_TIMEOUT"` ReadOnly bool `yaml:"readonly,omitempty" json:"readonly,omitempty" env:"-"` Notify string `yaml:"notify,omitempty" json:"notify,omitempty" env:"THEMEKIT_NOTIFY"` }
Env is the structure of a configuration for an environment.
Click to show internal directories.
Click to hide internal directories.