sarafu-vise-events/config/config.go
2025-01-13 08:44:15 +00:00

40 lines
829 B
Go

package config
import (
viseconfig "git.grassecon.net/grassrootseconomics/visedriver/config"
apiconfig "git.grassecon.net/grassrootseconomics/sarafu-api/config"
"git.grassecon.net/grassrootseconomics/visedriver/env"
)
var (
JetstreamURL string
JetstreamClientName string
)
const (
defaultJetstreamURL string = "localhost:4222"
defaultJetstreamClientName string = "omnom"
)
func LoadConfig() error {
err := viseconfig.LoadConfig()
if err != nil {
return err
}
err = apiconfig.LoadConfig()
if err != nil {
return err
}
JetstreamURL = env.GetEnv("NATS_JETSTREAM_URL", defaultJetstreamURL)
JetstreamClientName = env.GetEnv("NATS_JETSTREAM_CLIENT_NAME", defaultJetstreamClientName)
return nil
}
func DbConn() string {
return viseconfig.DbConn
}
func Language() string {
return viseconfig.DefaultLanguage
}