environment

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIntOrFatal

func GetIntOrFatal(key string) int

GetIntOrFatal returns value of environment variable that is expected to be an int, otherwise logs a Fatal error (and exits)

func GetListOrFatal

func GetListOrFatal(key string) []string

GetListOrFatal returns the key's value as a list or logs a Fatal error (and exits)

The value is expected to be a csv

NOTE: if the value is not csv, it is returned as is in a list with the original string

as the only element in the list

func GetLogLevel

func GetLogLevel() string

GetLogLevel returns the loglevet or panics. This is called before any logger is available. i.e. don't use a logger here.

func GetOrFatal

func GetOrFatal(key string) string

GetOrFatal returns the key's value or logs a Fatal error (and exits)

func GetRequired

func GetRequired(key string) (string, error)

GetRequired gets the value for the key, or an error if it is not set.

func GetTruthyOrFatal

func GetTruthyOrFatal(key string) bool

GetTruthyOrFatal returns true if key is set to a value that is truthy. Returns false otherwise.

func ReadIndirectOrFatal

func ReadIndirectOrFatal(varname string) string

ReadIndirectOrFatal reads filename and uses it to read a value from the file. Any error is Fatal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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