the yoruba word for "environment". this package provides convenient methods for parsing environment variables into your go program.
a Load
interface is exported by the package which supports reading .env files in a few different ways
ayika.Load.Default()
ayika.Load.Local("path1", "path2", ..."pathN")
ayika.Load.WithReader(reader)
envMap := ayika.Load.IntoVariable()
ayika.Value("<your env key>")
all numeric values are parsed as int64
.
ayika.Num("<your env key>")
ayika.Bool("<your env key>")
all float values are parsed as float64
ayika.Float("<your env key>")
type KeyValue struct {
Key string `json:"key"`
}
ayika.JSON[KeyValue]("<your env key>")
unit tests are located in the tests
folder and can be run with cd tests && go test
.