config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENV_LOCAL      = "local"
	ENV_PRODUCTION = "production"
	ENV_STAGING    = "staging"
)

Variables

This section is empty.

Functions

func Load

func Load[T EnvAware](ctx context.Context, loadConfig *LoadConfiguration[T]) (*T, error)

Types

type Application

type Application struct {
	Env     string `mapstructure:"env"`
	Name    string `mapstructure:"name"`
	Version string `mapstructure:"version"`
}

type EnvAware

type EnvAware interface {
	GetEnv() string
}

type LoadConfiguration

type LoadConfiguration[T EnvAware] struct {
	ConfigName  string
	ConfigPaths []string
	EnvPrefix   string
	PostLoaders []PostLoader[T]
	// contains filtered or unexported fields
}

func (*LoadConfiguration[T]) SeparateConfigNameAndType

func (l *LoadConfiguration[T]) SeparateConfigNameAndType() (string, string)

type PostLoader

type PostLoader[T EnvAware] func(*T) error

Jump to

Keyboard shortcuts

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