env

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 6 Imported by: 1

README

== Core utils

. Used by https://github.com/caarlos0/env[env]

Documentation

Index

Constants

View Source
const (
	KeyPath   = "PATH"
	KeyGoBin  = "GOBIN"
	KeyGoPath = string(vfs.RootTypeGoPath)
	KeyGoRoot = string(vfs.RootTypeGoRoot)
)

Variables

View Source
var (
	ErrFailedReadConfiguration = errors.New("failed to read configuration from environment")
)

Functions

func ReadEnvConfig

func ReadEnvConfig(cfg any) error

func ReadEnvConfigWithOptions

func ReadEnvConfigWithOptions(cfg any, opts *env.Options) error

func SlogAttrEnv

func SlogAttrEnv[E ListOrMap](env E) slog.Attr

Types

type List

type List = []string

func MapToSlices

func MapToSlices(envMap Map) List

type ListOrMap

type ListOrMap interface {
	List | Map
}

type Map

type Map = map[string]string

func MergeEnvs

func MergeEnvs[E ListOrMap](source E, additions ...Map) Map

func SlicesToMap

func SlicesToMap(env List) Map

Jump to

Keyboard shortcuts

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