env

package module
v1.1.0 Latest Latest
Warning

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

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

README

ENV Package

ENV is a lib that facilitates how developers can access environment variables during development. It extracts data from environment variables and converts it into its desired types automatically.

Supports String, Int, Float and Bool types.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool

func GetBool(name string, defaultValue ...bool) bool

GetBool extracts a Bool value from the given environment variable.

func GetFloat

func GetFloat(name string, defaultValue ...float64) float64

GetFloat extracts a Float value from the given environment variable.

func GetInt

func GetInt(name string, defaultValue ...int) int

GetInt extracts an Int value from the given environment variable.

func GetString

func GetString(name string, defaultValue ...string) string

GetString extracts a String value from the given environment variable.

func MustGetBool

func MustGetBool(name string) bool

MustGetBool extracts a Bool value from the given environment variable. It exits the application if not present.

func MustGetFloat

func MustGetFloat(name string) float64

MustGetFloat extracts a Float value from the given environment variable. It exits the application if not present.

func MustGetInt

func MustGetInt(name string) int

MustGetInt extracts an Int value from the given environment variable. It exits the application if not present.

func MustGetString

func MustGetString(name string) string

MustGetString extracts a String value from the given environment variable. It panics if not present.

Types

This section is empty.

Jump to

Keyboard shortcuts

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