postgresql & migrations

This commit is contained in:
yash 2026-02-25 20:22:13 +03:00
parent ae096d4820
commit 7f6cd8e557
15 changed files with 254 additions and 27 deletions

View file

@ -8,8 +8,9 @@ import (
)
type Config struct {
Logger Logger `yaml:"logger"`
Providers struct {
Logger Logger `yaml:"logger"`
Postgresql Postgresql `yaml:"postgresql"`
Providers struct {
Bybit Bybit `yaml:"bybit"`
} `yaml:"providers"`
}
@ -24,6 +25,13 @@ type Bybit struct {
BaseURL string `yaml:"base_url" env-default:"https://api.bybit.com"` // bybit api url
}
type Postgresql struct {
Address string `yaml:"address" env-required:"true"`
User string `yaml:"user" env-required:"true"`
Password string `yaml:"password" env-required:"true"`
DBName string `yaml:"db_name" env-required:"true"`
}
// MustLoad returns config or panic.
func MustLoad() *Config {
configPath := os.Getenv("CONFIG_PATH")