autoenv

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CaptureCallers uint8 = 16

CaptureCallers is the max amount of caller frames that should be captured using runtime.Callers to determine the absolute path of the main.go file.

View Source
var SkipCaller = -4

SkipCaller skips the amount of callers when determining the absolute path of the main.go file. When this value is negative, it is subtracted from the amount of captured caller frames. Otherwise, the absolute value is used.

Functions

func Unmarshal

func Unmarshal(v any) error

Unmarshal loads environment variables once using NewLoader and then decodes v using a env.NewDecoder.

Types

type Loader

type Loader struct {
	Dir string
	// contains filtered or unexported fields
}

func NewDevelopmentLoader

func NewDevelopmentLoader(skipCaller int, args ...string) *Loader

NewDevelopmentLoader returns a new Loader configured for development environments.

func NewLoader

func NewLoader() *Loader

func NewProductionLoader

func NewProductionLoader() *Loader

NewProductionLoader returns a new Loader configured for production environments.

func (*Loader) Load

func (l *Loader) Load() error

func (*Loader) PrefixDir

func (l *Loader) PrefixDir(path string) string

Jump to

Keyboard shortcuts

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