Add existing codebase

This commit is contained in:
Andrey Chervyakov 2021-04-12 17:01:00 +06:00
commit e12550a643
25 changed files with 1409 additions and 0 deletions

22
pkg/brainbuffer/config.go Normal file
View file

@ -0,0 +1,22 @@
package brainbuffer
import (
"github.com/knadh/koanf"
"github.com/knadh/koanf/providers/env"
"strings"
)
func NewConfig() *koanf.Koanf {
config := koanf.New(".")
loadValues(config)
return config
}
func loadValues(c *koanf.Koanf) {
envProvider := env.Provider("", ".", func(s string) string {
return strings.Replace(strings.ToLower(s), "_", ".", -1)
})
_ = c.Load(envProvider, nil)
}