implemented data sources with prisma in go

This commit is contained in:
2025-01-02 13:19:55 +00:00
parent cfb0bdf9cf
commit 615e749a12
55 changed files with 1399 additions and 788 deletions
+25
View File
@@ -0,0 +1,25 @@
package config
import (
"github.com/spf13/viper"
)
type Config struct {
DatabaseURL string
Port string
}
func LoadConfig(path string) (*Config, error) {
viper.AddConfigPath(path)
viper.SetConfigName("config")
viper.SetConfigType("yaml")
if err := viper.ReadInConfig(); err != nil {
return nil, err
}
return &Config{
DatabaseURL: viper.GetString("database.url"),
Port: viper.GetString("server.port"),
}, nil
}