configuration

package module
v0.0.0-...-214356f Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: MIT Imports: 9 Imported by: 1

README

config-mgtm

config-mgtm is a wrapper on top of viper

How to use

go get github.com/csturiale/config-mgtm

Have a file yaml under assets/application/configuration/ folder named configuration.yaml Then can be used as follow

configuration.GetBool("my.path")

Per env use

Define the env environment variable like:

export env=prod

And create a file named configuration-prod.yaml

This will be merged with the base configuration.yaml

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool

func GetBool(key string) bool

func GetBoolOrDefault

func GetBoolOrDefault(key string, val bool) bool

func GetInt

func GetInt(key string) int

func GetIntOrDefault

func GetIntOrDefault(key string, val int) int

func GetItem

func GetItem(key string) any

func GetItemOrDefault

func GetItemOrDefault(key string, val any) any

func GetItemToStruct

func GetItemToStruct(key string, a any)

func GetString

func GetString(key string) string

func GetStringOrDefault

func GetStringOrDefault(key string, val string) string

func GetStringSlice

func GetStringSlice(key string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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