config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config provides functions which can be used to extract environment variables and parse them to the right type.

Index

Constants

View Source
const (
	// ProdEnv can be used as value when reading out the type of environment.
	ProdEnv string = "production"
	// TestEnv can be used as value when reading out the type of environment.
	TestEnv string = "test"
	// DevEnv can be used as value when reading out the type of environment.
	DevEnv string = "development"
)

Variables

This section is empty.

Functions

func EnvBool added in v0.1.1

func EnvBool(key string, defaultValue bool) bool

EnvBool extracts a boolean environment variable.

func EnvFloat added in v0.1.1

func EnvFloat(key string, defaultValue float64) float64

EnvFloat extracts a float environment variable.

func EnvInt added in v0.1.1

func EnvInt(key string, defaultValue int) int

EnvInt extracts an integer environment variable.

func EnvStr added in v0.1.1

func EnvStr(key string, defaultValue string) string

EnvStr extracts a string environment variable.

func EnvStrArray added in v0.1.1

func EnvStrArray(key string, defaultValue []string) []string

EnvStrArray extracts a string array environment variable. The values should be separated by ','.

Types

This section is empty.

Jump to

Keyboard shortcuts

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