add user management functionality with OTP verification and consent handling, DI introduced

This commit is contained in:
2025-08-10 10:38:49 +03:00
parent 6a9061a3de
commit 5d80a68b44
30 changed files with 828 additions and 528 deletions

View File

@ -1,9 +1,10 @@
package config
import (
"log"
"github.com/joho/godotenv"
"github.com/spf13/viper"
"log"
)
type Config struct {
@ -20,11 +21,16 @@ type Config struct {
Host string
Password string
}
DB struct {
Host string
Port int
User string
Password string
Dbname string
}
}
var Cfg *Config
func Init() {
func NewConfig() Config {
err := godotenv.Load()
if err != nil {
log.Println("Error loading .env file")
@ -48,5 +54,5 @@ func Init() {
if err != nil {
log.Fatalf("Unable to decode config into struct, %v", err)
}
Cfg = &config
return config
}