config

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key, def string) string

Get returns the value of the environment variable `key` if set. If not set, and `key + "_FILE"` is set, the file at that path is read and its trimmed contents are returned. If neither are set, def is returned.

func GetBool

func GetBool(key string, def bool) bool

GetBool returns the boolean value of the environment variable `key`. Recognised true values are: 1, t, true, y, yes (case-insensitive). Recognised false values are: 0, f, false, n, no.

func GetInt

func GetInt(key string, def int) int

GetInt returns the integer value of the environment variable `key`. It parses the result of Get(key, ""). If parsing fails or the variable is unset, def is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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