Help us shape the future of Go! Take the 2026 Go Developer Survey

envparse

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package envparse provides a way to parse environment variables from a struct

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSpecification = errors.New("specification must be a struct pointer")

ErrInvalidSpecification indicates that a specification is of the wrong type.

Functions

This section is empty.

Types

type Config

type Config struct {
	// FieldTagName is the name of the struct tag to use for the field name
	FieldTagName string
	// Skipper is the value of the tag to skip parsing of the field
	Skipper string
}

func (Config) GatherEnvInfo

func (c Config) GatherEnvInfo(prefix string, spec any) ([]VarInfo, error)

GatherEnvInfo gathers information about the specified struct, including defaults and environment variable names.

type VarInfo added in v0.4.5

type VarInfo struct {
	FieldName string
	FullPath  string
	Key       string
	Type      reflect.Type
	Tags      reflect.StructTag
}

VarInfo maintains information about the configuration variable

Jump to

Keyboard shortcuts

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