Refactor to use conndata as menustorageservice conn arg

This commit is contained in:
lash
2025-01-04 20:36:18 +00:00
parent f61e65f4fe
commit 450dfa02cc
12 changed files with 98 additions and 125 deletions

View File

@@ -34,6 +34,7 @@ var (
VoucherTransfersURL string
VoucherDataURL string
CheckAliasURL string
DbConn string
)
func setBase() error {
@@ -43,14 +44,20 @@ func setBase() error {
dataURLBase = initializers.GetEnv("DATA_URL_BASE", "http://localhost:5006")
BearerToken = initializers.GetEnv("BEARER_TOKEN", "")
_, err = url.JoinPath(custodialURLBase, "/foo")
_, err = url.Parse(custodialURLBase)
if err != nil {
return err
}
_, err = url.JoinPath(dataURLBase, "/bar")
_, err = url.Parse(dataURLBase)
if err != nil {
return err
}
return nil
}
func setConn() error {
DbConn = initializers.GetEnv("DB_CONN", "")
return nil
}
@@ -60,6 +67,10 @@ func LoadConfig() error {
if err != nil {
return err
}
err = setConn()
if err != nil {
return err
}
CreateAccountURL, _ = url.JoinPath(custodialURLBase, createAccountPath)
TrackStatusURL, _ = url.JoinPath(custodialURLBase, trackStatusPath)
BalanceURL, _ = url.JoinPath(custodialURLBase, balancePathPrefix)