Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugFromEnvironment ¶ added in v0.1.22
func DebugFromEnvironment(env Environment) bool
Gin has two log modes, expressed by string constants. Gin also has a third mode for testing, but that is reserved for its own internal use.
GORM has two log modes, expressed by an integer: 2 enables detailed logs, 1 disables logging, and 0 prints only errors. GORM defaults to 0; calling gorm.LogMode(true) set the mode to 2; calling gorm.LogMode(false) will set the mode to 1. Goat will only call gorm.LogMode to enable detailed logs and will never disable GORM logging completely.
Types ¶
type Environment ¶
type Environment string
Environment represents the environment in which a Goat app is running. For example, 'local' would be a developers local machine, 'test' would be the environment used while running unit tests, while 'dev', 'staging', and 'prod' are reserved for deployment environments.
In 'local' and 'test' environments, Gin and GORM are run in debug mode.
const ( EnvironmentLocal Environment = "local" EnvironmentTest Environment = "test" EnvironmentDev Environment = "dev" EnvironmentStaging Environment = "staging" EnvironmentProd Environment = "prod" )
func EnvironmentFromString ¶
func EnvironmentFromString(s string) (Environment, error)
func (Environment) String ¶
func (t Environment) String() string