env

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Getter

type Getter struct {
	// contains filtered or unexported fields
}

Getter provides methods to get environment variables with defaults

func New

func New(prefix string) *Getter

New creates a new environment variable getter with an optional prefix

func (*Getter) GetBool

func (g *Getter) GetBool(key string, defaultValue bool) bool

func (*Getter) GetDuration

func (g *Getter) GetDuration(key string, defaultValue time.Duration) (time.Duration, error)

func (*Getter) GetInt

func (g *Getter) GetInt(key string, defaultValue int) int

func (*Getter) GetString

func (g *Getter) GetString(key, defaultValue string) string

Jump to

Keyboard shortcuts

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