Documentation
¶
Index ¶
Constants ¶
View Source
const Version = "1.0.3"
Version is the current version of the API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
App AppConfig
DB DatabaseConfig
Redis RedisConfig
JWT JWTConfig
Log LogConfig
Storage StorageConfig
RateLimit RateLimitConfig
IPRateLimit IPRateLimitConfig
WhatsApp WhatsAppConfig
Webhook WebhookConfig
Dashboard DashboardConfig
}
type DashboardConfig ¶
type DashboardConfig struct {
Enabled bool `env:"DASHBOARD_ENABLED" envDefault:"true"`
}
type DatabaseConfig ¶
type DatabaseConfig struct {
URL string `env:"DATABASE_URL"`
Host string `env:"DB_HOST" envDefault:"localhost"`
Port int `env:"DB_PORT" envDefault:"5432"`
User string `env:"DB_USER" envDefault:"postgres"`
Password string `env:"DB_PASSWORD" envDefault:"postgres"`
Name string `env:"DB_NAME" envDefault:"postgres"`
SSLMode string `env:"DB_SSLMODE" envDefault:"disable"`
}
func (DatabaseConfig) DSN ¶
func (cfg DatabaseConfig) DSN() string
DSN retorna a string de conexão em formato aceito pelo pgxpool.
type IPRateLimitConfig ¶
type IPRateLimitConfig struct {
Enabled bool `env:"IP_RATE_LIMIT_ENABLED" envDefault:"true"`
Requests int `env:"IP_RATE_LIMIT_REQUESTS" envDefault:"100"`
WindowSeconds int `env:"IP_RATE_LIMIT_WINDOW_SECONDS" envDefault:"900"`
SkipPrivateIPs bool `env:"IP_RATE_LIMIT_SKIP_PRIVATE_IPS" envDefault:"true"`
}
type RateLimitConfig ¶
type RedisConfig ¶
type StorageConfig ¶
type WebhookConfig ¶
type WebhookConfig struct {
Workers int `env:"WEBHOOK_WORKERS" envDefault:"4"`
}
type WhatsAppConfig ¶
type WhatsAppConfig struct {
SessionKeyEnc string `env:"WHATSAPP_SESSION_KEY_ENC" envDefault:"apime-session-key-change-in-production"`
}
Click to show internal directories.
Click to hide internal directories.