Documentation
¶
Index ¶
Constants ¶
const ( EnvironmentPrefix = "GS_ENVS_PREFIX" IncludeEnvPatterns = "INCLUDE_ENV_PATTERNS" ExcludeEnvPatterns = "EXCLUDE_ENV_PATTERNS" )
const CommandArgsPrefix = "GS_ARGS_PREFIX"
CommandArgsPrefix defines the environment variable name used to override the default option prefix.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
LocalFile *PropertySources
RemoteFile *PropertySources
RemoteProp gs.Properties
Environment *Environment
CommandArgs *CommandArgs
}
AppConfig is a layered app configuration.
func NewAppConfig ¶
func NewAppConfig() *AppConfig
type BootConfig ¶
type BootConfig struct {
LocalFile *PropertySources
Environment *Environment
CommandArgs *CommandArgs
}
BootConfig is a layered boot configuration.
func NewBootConfig ¶
func NewBootConfig() *BootConfig
func (*BootConfig) Refresh ¶
func (c *BootConfig) Refresh() (gs.Properties, error)
Refresh merges all layers into a properties as read-only.
type CommandArgs ¶
type CommandArgs struct{}
CommandArgs represents a structure for handling command-line parameters.
func NewCommandArgs ¶
func NewCommandArgs() *CommandArgs
NewCommandArgs creates and returns a new CommandArgs instance.
func (*CommandArgs) CopyTo ¶
func (c *CommandArgs) CopyTo(out *conf.Properties) error
CopyTo processes command-line parameters and sets them as key-value pairs in the provided conf.Properties. Parameters should be passed in the form of `-D key[=value/true]`.
type ConfigType ¶
type ConfigType string
const ( ConfigTypeLocal ConfigType = "local" ConfigTypeRemote ConfigType = "remote" )
type Environment ¶
type Environment struct{}
Environment environment variable
func NewEnvironment ¶
func NewEnvironment() *Environment
func (*Environment) CopyTo ¶
func (c *Environment) CopyTo(p *conf.Properties) error
CopyTo add environment variables that matches IncludeEnvPatterns and exclude environment variables that matches ExcludeEnvPatterns.
type PropertySources ¶
type PropertySources struct {
// contains filtered or unexported fields
}
PropertySources is a collection of locations.
func NewPropertySources ¶
func NewPropertySources(configType ConfigType, configName string) *PropertySources
func (*PropertySources) AddLocation ¶
func (p *PropertySources) AddLocation(location ...string)
AddLocation adds a location.