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 {
Choice string
Redis CacheConfigRedis
Otter CacheConfigOtter
Expiration struct {
StaticFile time.Duration
Page time.Duration
}
}
CacheConfig stores the cache configuration
type CacheConfigOtter ¶
type CacheConfigOtter struct {
Capacity int
}
CacheConfigOtter stores the cache configuration for the otter cache
type CacheConfigRedis ¶
type CacheConfigRedis struct {
Hostname string
Port int
Password string
Database int
TestDatabase int
}
CacheConfigRedis stores the cache configuration for the redis cache
type Config ¶
type Config struct {
HTTP HTTPConfig
App AppConfig
Cache CacheConfig
Database DatabaseConfig
Tasks TasksConfig
Mail MailConfig
Stripe StripeConfig
AIs []AIConfig
}
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
type MailConfig ¶
type MailConfig struct {
Hostname string
Port uint16
User string
Password string
FromAddress string
}
MailConfig stores the mail configuration
type StripeConfig ¶
MailConfig stores the stripe configuration
Click to show internal directories.
Click to hide internal directories.