env

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 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 Provider

type Provider struct {
	// Prefix is an optional prefix to filter environment variables.
	Prefix string
}

Provider implements configuration.Provider for environment variables.

Example:

p := &env.Provider{Prefix: "APP_"}
data, err := p.Load(ctx)

func New

func New(prefix string) *Provider

New creates a new environment variable provider with an optional prefix.

func (*Provider) Load

func (p *Provider) Load(ctx context.Context) (map[string]any, error)

Load reads all environment variables, filtering by prefix if set.

func (*Provider) Name

func (p *Provider) Name() string

Name returns "env".

Jump to

Keyboard shortcuts

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