env

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package env provides utilities for parsing environment variables into nested Go data structures. It includes functions to filter unsafe variables, normalize keys, and construct hierarchical maps from environment variable names using specified separators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildNestedMap

func BuildNestedMap(data map[string]any, key string, value any, separator string)

BuildNestedMap creates a nested map structure from a key with separators.

func IsUnsafeVar

func IsUnsafeVar(key string) bool

IsUnsafeVar checks if an environment variable should be filtered out.

func ParseVariables

func ParseVariables(vars map[string]string, pre, sep string) map[string]any

ParseVariables processes a map of environment variables into a nested map structure. It takes the following parameters: - vars: map of environment variable key-value pairs to process - pre: prefix to filter variables by (variables not matching prefix are excluded) - sep: separator used in environment variable names to create nested structure Returns a nested map[string]any containing the processed environment variables.

Types

This section is empty.

Jump to

Keyboard shortcuts

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