utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlphaNumeric

func IsAlphaNumeric(s string) bool

func LoadConfig

func LoadConfig[cfg any]() (cfg, error)

LoadConfig will load any matching environment variables into the generic struct passed to the function. The config package can match struct fields in PascalCase to env variables of snake case. for example:

type Config struct {
		FooBar int
}

ENV:

FOO_BAR=15

this will load 15 into the FooBar field above.

additionally, you can use field tags to match the environment variable casing exactly.

type Config struct {
		someRandomField string `config:"I_WANT_THIS_FIELD"
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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