setup tasks auth middleware and compose

This commit is contained in:
timka
2025-12-17 17:42:16 +03:00
parent 8052af3cc7
commit 91a72f25fd
4 changed files with 12 additions and 71 deletions
+3 -1
View File
@@ -20,6 +20,7 @@ type Config struct {
DBUser string
DBPassword string
DBName string
AuthSvcAddr string
}
func Load() (*Config, error) {
@@ -35,6 +36,7 @@ func Load() (*Config, error) {
DBUser: getEnv("POSTGRES_USERNAME", "postgres"),
DBPassword: getEnv("POSTGRES_PASSWORD", "postgres"),
DBName: getEnv("POSTGRES_DATABASE", "postgres"),
AuthSvcAddr: getEnv("AUTH_SVC_ADDR", "localhost:50051"),
}, nil
}
@@ -71,4 +73,4 @@ func (c Config) BuildPostgresConnStr() string {
func (c Config) BuildPostgresDSN() string {
return fmt.Sprintf("postgresql://%s:%s@%s/%s?sslmode=disable",
c.DBUser, c.DBPassword, net.JoinHostPort(c.DBHost, strconv.Itoa(c.DBPort)), c.DBName)
}
}