Documentation
¶
Index ¶
- func Bool(name string, defaultValue bool) bool
- func CommitHash() string
- func DatabaseURL() string
- func Duration(name string, defaultValue time.Duration) (time.Duration, error)
- func Float(name string, defaultValue float64) float64
- func GetListen(defaultPort string) (string, string)
- func GetListenByName(key string, defaultPort string) (string, string)
- func Int(name string, defaultValue int) int
- func Int64(name string, defaultValue int64) int64
- func RedisURL() string
- func SentryDSN() string
- func SetPrefix(name string)
- func String(name, defaultValue string) string
- func StringEnv(name, defaultValue string, env GoEnv) string
- func TracingSampleRate(defaultValue float64) float64
- func Uint(name string, defaultValue uint) uint
- func Uint64(name string, defaultValue uint64) uint64
- func ZipkinURL() string
- type GoEnv
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitHash ¶
func CommitHash() string
func DatabaseURL ¶
func DatabaseURL() string
DatabaseURL returns value of DATABASE_URL if running in test mode returns TEST_DATABASE_URL
func Duration ¶
Duration parses the duration from the `name` environment variable. If the environment variable is not defined, it returns the given default value. It returns a duration or an error on parse error.
func GetListenByName ¶
GetListenByName returns :8080 and 8080 for ListenAddr and Port, from key env var
func RedisURL ¶
func RedisURL() string
RedisURL returns value of REDIS_URL if running in test mode returns TEST_REDIS_URL
func SentryDSN ¶
func SentryDSN() string
SentryDSN returns the Sentry DSN (https://docs.sentry.io/quickstart/#configure-the-dsn) from an environment variable
func SetPrefix ¶
func SetPrefix(name string)
SetPrefix sets environment variables prefix during development
func TracingSampleRate ¶
TracingSampleRate parses the TRACING_SAMPLE_RATE environment variable value to a float.