sys

package
v0.1.31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2020 License: MIT Imports: 8 Imported by: 0

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 Config

type Config struct {
	Env  Environment
	CMD  cmd.Config
	DB   db.Config
	HTTP http.Config
	Log  log.Config
}

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

type Goat

type Goat struct {
	Env  Environment
	CMD  cmd.Service
	DB   db.Service
	HTTP http.Service
	Log  log.Service
	// contains filtered or unexported fields
}

func Init

func Init() Goat

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL