Documentation
¶
Index ¶
Constants ¶
View Source
const ( // StageDev development environment. StageDev = "development" // StageTest test environment. StageTest = "test" // StageStaging staging environment. StageStaging = "staging" // StageProd production environment. StageProd = "production" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `yaml:"name"` Version string `yaml:"version"` Stage string `yaml:"stage"` SecretKey string `yaml:"secret-key"` HTTP HTTPConfig `yaml:"http"` App interface{} `yaml:"app"` }
Config configuration.
var G *Config
G global config instance
func (*Config) IsDevelopment ¶
IsDevelopment returns true if current stage is development.
func (*Config) UnmarshalApp ¶
UnmarshalApp configuration to out.
type HTTPConfig ¶
type HTTPConfig struct { Listen string `yaml:"listen"` ReadHeaderTimeoutMS uint32 `yaml:"read-header-timeout-ms"` ReadTimeoutMS uint32 `yaml:"read-timeout-ms"` WriteTimeoutMS uint32 `yaml:"write-timeout-ms"` CookieMaxAge int `yaml:"cookie-max-age"` }
HTTPConfig configuration of HTTP
func (*HTTPConfig) ListenAddr ¶
func (hc *HTTPConfig) ListenAddr() string
Click to show internal directories.
Click to hide internal directories.