Documentation
¶
Index ¶
Constants ¶
const ( UnitTestingEnv string = "unit_testing" IntegrationTestingEnv string = "integration_testing" DevelopmentEnv string = "development" ProductionEnv string = "production" EnvironmentStringKey string = "HYPERFLEET_ENV" EnvironmentDefault = ProductionEnv // Database SSL modes SSLModeDisable string = "disable" )
Variables ¶
This section is empty.
Functions ¶
func ApplyEnvironmentOverrides ¶ added in v0.2.0
func ApplyEnvironmentOverrides(cfg *config.ApplicationConfig) error
ApplyEnvironmentOverrides applies environment-specific configuration overrides This is used by the new config system to apply environment-specific settings (e.g., development environment disables JWT and TLS)
func GetEnvironmentStrFromEnv ¶
func GetEnvironmentStrFromEnv() string
Types ¶
type ApplicationConfig ¶
type ApplicationConfig struct {
ApplicationConfig *config.ApplicationConfig
}
type Database ¶
type Database struct {
SessionFactory db.SessionFactory
}
type Env ¶
type Env struct {
Handlers Handlers
Database Database
Config *config.ApplicationConfig
Name string
Services Services
}
func Environment ¶
func Environment() *Env
func (*Env) Initialize ¶
Initialize loads the environment's resources This should be called after the e.Config has been set appropriately though AddFlags and parsing, done elsewhere The environment does NOT handle flag parsing
func (*Env) LoadServices ¶
func (e *Env) LoadServices()
func (*Env) Seed ¶
func (e *Env) Seed() *errors.ServiceError
func (*Env) SetEnvironmentDefaults ¶ added in v0.2.0
SetEnvironmentDefaults sets environment-specific flag defaults
type EnvironmentImpl ¶
type EnvironmentImpl interface {
EnvironmentDefaults() map[string]string
OverrideConfig(c *config.ApplicationConfig) error
OverrideServices(s *Services) error
OverrideDatabase(s *Database) error
OverrideHandlers(c *Handlers) error
}
EnvironmentImpl defines a set of behaviors for a runtime environment. Each environment provides a set of flags for basic set/override of the environment and configuration functions for each component type.
type Services ¶
type Services struct {
// contains filtered or unexported fields
}