Documentation
¶
Index ¶
- Constants
- func LoadConfigFromPath(ctx context.Context, configPath string, config interface{}) error
- func SubstituteConfigValues(v reflect.Value)
- type APIServerConfig
- type App
- type AppConfig
- type AuthConfig
- type Backend
- type BasicUser
- type CORSConfig
- type Config
- type Dependant
- type Options
- type PatternEntry
Constants ¶
const ( DefaultConfigType = "yaml" DefaultConfigDir = "./appconfig" DefaultConfigFileName = "default" WorkDirEnv = "WORKDIR" EnvPrefix = "env|" FilePrefix = "file|" )
Default options for configuration loading.
Variables ¶
This section is empty.
Functions ¶
func LoadConfigFromPath ¶ added in v0.5.3
LoadConfigFromPath reads a configuration from a file path or HTTP URL and unmarshalls into config. The path can be:
- A local file path (relative to WORKDIR/appconfig or absolute)
- An HTTP/HTTPS URL
For local file paths, it uses the same config path resolution as the main config loader. For HTTP URLs, it fetches the content via HTTP GET request with context support.
func SubstituteConfigValues ¶
SubstituteConfigValues recursively walks through the config struct and replaces string values of the form 'env|VAR' or 'file|/path' with the corresponding value.
Types ¶
type APIServerConfig ¶ added in v0.1.0
type APIServerConfig struct {
Address string `yaml:"address"`
Auth AuthConfig `yaml:"auth"`
CORS CORSConfig `yaml:"cors"`
}
type App ¶
type App struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Environment string `yaml:"environment"`
Debug bool `yaml:"debug"`
}
App represents the application configuration
type AppConfig ¶
type AppConfig struct {
App App `yaml:"app"`
LDAP ldap.LDAP `yaml:"ldap"`
Cache cache.Config `yaml:"cache"`
Backends []Backend `yaml:"backends"`
Pattern map[string][]PatternEntry `yaml:"pattern"`
UsernautUserOffboardingInterval string `yaml:"usernautUserOffboardingInterval"`
OffboardUserExclusionListConfigPath string `yaml:"offboardUserExclusionListConfigPath"`
HttpClient struct {
ConnectionPoolConfig httpclient.ConnectionPoolConfig `yaml:"connectionPoolConfig"`
HystrixResiliencyConfig httpclient.HystrixResiliencyConfig `yaml:"hystrixResiliencyConfig"`
} `yaml:"httpClient"`
APIServer APIServerConfig `yaml:"apiServer"`
BackendMap map[string]map[string]Backend `yaml:"-"`
}
Config represents the top-level configuration structure
func LoadConfig ¶
type AuthConfig ¶ added in v0.1.0
type Backend ¶
type Backend struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Enabled bool `yaml:"enabled"`
DependsOn Dependant `yaml:"depends_on,omitempty" mapstructure:"depends_on,omitempty"`
Connection map[string]interface{} `yaml:"connection"`
}
Backend represents a backend service configuration
type CORSConfig ¶ added in v0.1.0
type CORSConfig struct {
AllowedOrigins []string `yaml:"allowed_origins"`
}
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is a wrapper over a underlying config loader implementation.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig returns new config struct with default options.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options is config options.
func NewDefaultOptions ¶
func NewDefaultOptions() Options
type PatternEntry ¶
PatternEntry represents the input and output pattern of group names