Initial scaffold: Go module, SQLite schema, config loader, Telegram bot with webhook/polling modes

This commit is contained in:
2026-06-23 20:22:46 +03:30
parent c803239193
commit 4146e35f35
9 changed files with 600 additions and 0 deletions

24
internal/config/loader.go Normal file
View File

@@ -0,0 +1,24 @@
package config
import (
"encoding/json"
"os"
)
type Config struct {
BotToken string `json:"bot_token"`
ProxyAddr string `json:"proxy_address"`
LogLevel string `json:"log_level"`
}
func Load(path string) (*Config, error) {
data, err := os.ReadFile(path)
if err != nil {
return nil, err
}
var cfg Config
if err := json.Unmarshal(data, &cfg); err != nil {
return nil, err
}
return &cfg, nil
}