2024-11-03 18:43:07 +01:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
2025-01-12 13:16:55 +01:00
|
|
|
viseconfig "git.grassecon.net/grassrootseconomics/visedriver/config"
|
|
|
|
"git.grassecon.net/grassrootseconomics/visedriver/env"
|
2024-11-03 18:43:07 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
JetstreamURL string
|
|
|
|
JetstreamClientName string
|
|
|
|
)
|
|
|
|
|
2025-01-12 13:16:55 +01:00
|
|
|
const (
|
|
|
|
defaultJetstreamURL string = "localhost:4222"
|
|
|
|
defaultJetstreamClientName string = "omnom"
|
|
|
|
)
|
|
|
|
|
2024-11-03 18:43:07 +01:00
|
|
|
|
2025-01-12 13:16:55 +01:00
|
|
|
func LoadConfig() error {
|
|
|
|
err := viseconfig.LoadConfig()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
JetstreamURL = env.GetEnv("NATS_JETSTREAM_URL", defaultJetstreamURL)
|
|
|
|
JetstreamClientName = env.GetEnv("NATS_JETSTREAM_CLIENT_NAME", defaultJetstreamClientName)
|
|
|
|
return nil
|
|
|
|
}
|
2024-11-03 18:43:07 +01:00
|
|
|
|
2025-01-12 13:16:55 +01:00
|
|
|
func DbConn() string {
|
|
|
|
return viseconfig.DbConn
|
2024-11-03 18:43:07 +01:00
|
|
|
}
|