backend/pkg/notification/config/config.go

47 lines
1.0 KiB
Go
Raw Permalink Normal View History

2025-10-02 16:16:33 +00:00
package config
2025-10-02 16:36:34 +00:00
import "time"
2025-10-02 16:16:33 +00:00
type SMTPConfig struct {
Enable bool
Sort int
GoroutinePoolNum int
Host string
Port int
Username string
Password string
}
type AmazonSesSettings struct {
Enable bool
Sort int
PoolSize int
Region string
Sender string
Charset string
AccessKey string
SecretKey string
Token string
}
type MitakeSMSSender struct {
Enable bool
Sort int
PoolSize int
User string
Password string
}
2025-10-02 16:36:34 +00:00
// DeliveryConfig 傳送重試配置
type DeliveryConfig struct {
MaxRetries int `json:"max_retries"` // 最大重試次數
InitialDelay time.Duration `json:"initial_delay"` // 初始重試延遲 (100ms)
BackoffFactor float64 `json:"backoff_factor"` // 指數退避因子 (2.0)
MaxDelay time.Duration `json:"max_delay"` // 最大延遲時間
Timeout time.Duration `json:"timeout"` // 單次發送超時時間
EnableHistory bool `json:"enable_history"` // 是否啟用歷史記錄
}