conf

package
v0.3.16 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package conf contains app configuration types and methods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create[T any](cfg *T, lookup dict.Strings, defaults *Defaults) *T

Create decorates a Config object with the contents of lookup

func LoadEnv

func LoadEnv(path string) error

LoadEnv loads environment variables from given path

func LoadRequiredEnv

func LoadRequiredEnv(path string, requiredKeys []string) error

LoadRequiredEnv loads environment variables from given path and checks that all required keys are set

func Lookup

func Lookup(rq *my.Request, appKeys []string, kvSchema *model.Schema[KV]) (dict.Strings, error)

Lookup loads a Config map from database

Types

type Defaults

type Defaults struct {
	UintMap       map[string]uint
	IntMap        dict.Ints
	StringMap     dict.Strings
	StringListMap dict.StringLists
}

type KV

type KV struct {
	Key           string `col:"AppKey"`
	Value         string `col:"AppValue"`
	LastUpdatedAt model.DateTime
}

Jump to

Keyboard shortcuts

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