bootstrap

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package bootstrap contains utility functions to read environment variables, if a default is not provided and the value of an environment variable is not set then the application will panic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoolEnvVar

func GetBoolEnvVar(key string) bool

GetBoolEnvVar reads an environment variable and returns the value as a bool, if the environment variable is not set then the application will panic.

func GetEnvVar

func GetEnvVar(key string) string

GetEnvVar reads an environment variable and returns the value as a string, if the environment variable is not set then the application will panic.

func GetIntEnvVar

func GetIntEnvVar(key string) int

GetIntEnvVar reads an environment variable and returns the value as an int, if the environment variable is not set then the application will panic.

func GetOptionalBoolEnvVar

func GetOptionalBoolEnvVar(key string, def bool) bool

GetOptionalBoolEnvVar reads an environment variable and returns the value as a bool, or the default value if the environment variable is not set. If the environment variable is set but cannot be parsed as a bool then the application will panic.

func GetOptionalEnvVar

func GetOptionalEnvVar(key string, def string) string

GetOptionalEnvVar reads an environment variable and returns the value as a string, or the default value if the environment variable is not set.

func GetOptionalFloatEnvVar

func GetOptionalFloatEnvVar(key string, def float64) float64

GetOptionalFloatEnvVar reads an environment variable and returns the value as a float64, if the environment variable is not set then the application will panic. If the environment variable is set but cannot be parsed as a float64 then the application will panic.

func GetOptionalIntEnvVar

func GetOptionalIntEnvVar(key string, def int) int

GetOptionalIntEnvVar reads an environment variable and returns the value as an int, or the default value if the environment variable is not set. If the environment variable is set but cannot be parsed as an int then the application will panic.

Types

This section is empty.

Jump to

Keyboard shortcuts

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