config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 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

func EnvBool(key string, defaultValue bool) bool

EnvBool extracts a boolean environment variable.

func EnvFloat

func EnvFloat(key string, defaultValue float64) float64

EnvFloat extracts a float environment variable.

func EnvInt

func EnvInt(key string, defaultValue int) int

EnvInt extracts an integer environment variable.

func EnvStr

func EnvStr(key string, defaultValue string) string

EnvStr extracts a string environment variable.

func EnvStrArray

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

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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