Join webbapp core modules into single package

This commit is contained in:
eleksir
2025-10-12 16:42:16 +03:00
parent 3932835d47
commit d5c6d5719a
12 changed files with 203 additions and 176 deletions

37
internal/config/types.go Normal file
View File

@@ -0,0 +1,37 @@
// Этот package нужен, чтобы разбить кольцевую зависимость.
package config
import (
"github.com/cockroachdb/pebble"
"github.com/go-redis/redis/v8"
)
// MyConfig структурка, описывающая конфиг.
type MyConfig struct {
Server string `json:"server,omitempty"`
Port int `json:"port,omitempty"`
Timeout int `json:"timeout,omitempty"`
Loglevel string `json:"loglevel,omitempty"`
Log string `json:"log,omitempty"`
Channel string `json:"channel,omitempty"`
DataDir string `json:"datadir,omitempty"`
Csign string `json:"csign,omitempty"`
ForwardsMax int64 `json:"forwards_max,omitempty"`
OpenWeatherMap struct {
Enabled bool `json:"enabled,omitempty"`
Country bool `json:"country,omitempty"`
Appid string `json:"appid,omitempty"`
} `json:"openweathermap,omitempty"`
Flickr struct {
Enabled bool `json:"enabled,omitempty"`
Key string `json:"key,omitempty"`
Secret string `json:"secret,omitempty"`
OAuthToken string `json:"oauth_token,omitempty"`
OAuthTokenSecret string `json:"oauth_token_secret,omitempty"`
} `json:"flickr,omitempty"`
UserAgents []string `json:"user_agents,omitempty"`
PcacheDB map[string]*pebble.DB
RedisClient *redis.Client
}
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */