Documentation
¶
Index ¶
Constants ¶
View Source
const ( // TemplateExt stores the extension used for the template files TemplateExt = ".gohtml" // StaticDir stores the name of the directory that will serve static files StaticDir = "static" // StaticPrefix stores the URL prefix used when serving static files StaticPrefix = "files" )
View Source
const ( // EnvLocal represents the local environment EnvLocal environment = "local" // EnvTest represents the test environment EnvTest environment = "test" // EnvDevelop represents the development environment EnvDevelop environment = "dev" // EnvStaging represents the staging environment EnvStaging environment = "staging" // EnvQA represents the qa environment EnvQA environment = "qa" // EnvProduction represents the production environment EnvProduction environment = "prod" )
Variables ¶
This section is empty.
Functions ¶
func SwitchEnvironment ¶
func SwitchEnvironment(env environment)
SwitchEnvironment sets the environment variable used to dictate which environment the application is currently running in. This must be called prior to loading the configuration in order for it to take effect.
Types ¶
type AppConfig ¶
type AppConfig struct { Name string Environment environment EncryptionKey string Timeout time.Duration PasswordToken struct { Expiration time.Duration Length int } EmailVerificationTokenExpiration time.Duration }
AppConfig stores application configuration
type CacheConfig ¶
type CacheConfig struct { Capacity int Expiration struct { StaticFile time.Duration Page time.Duration } }
CacheConfig stores the cache configuration
type Config ¶
type Config struct { HTTP HTTPConfig App AppConfig Cache CacheConfig Database DatabaseConfig Tasks TasksConfig Mail MailConfig }
Config stores complete configuration
type DatabaseConfig ¶
DatabaseConfig stores the database configuration
type HTTPConfig ¶
type HTTPConfig struct { Hostname string Port uint16 ReadTimeout time.Duration WriteTimeout time.Duration IdleTimeout time.Duration TLS struct { Enabled bool Certificate string Key string } }
HTTPConfig stores HTTP configuration
Click to show internal directories.
Click to hide internal directories.