2 Commits

Author SHA1 Message Date
d3m0k1d
efa9abb289 feat: add actions to rule struct
All checks were successful
build / build (push) Successful in 2m18s
2026-02-23 23:18:43 +03:00
d3m0k1d
2747abfc04 feat: add struct for actions 2026-02-23 23:18:26 +03:00
3 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1 @@
package actions

View File

@@ -0,0 +1 @@
package actions

View File

@@ -31,9 +31,29 @@ type Rule struct {
Method string `toml:"method"` Method string `toml:"method"`
MaxRetry int `toml:"max_retry"` MaxRetry int `toml:"max_retry"`
BanTime string `toml:"ban_time"` BanTime string `toml:"ban_time"`
Action []Action
} }
type Metrics struct { type Metrics struct {
Enabled bool `toml:"enabled"` Enabled bool `toml:"enabled"`
Port int `toml:"port"` Port int `toml:"port"`
} }
// Actions
type Action struct {
Type string `toml:"type"`
Enabled bool `toml:"enabled"`
URL string `toml:"url"`
Headers map[string]string `toml:"headers"`
Body string `toml:"body"`
Email string `toml:"email"`
EmailSender string `toml:"email_sender"`
EmailSubject string `toml:"email_subject"`
SMTPHost string `toml:"smtp_host"`
SMTPPort int `toml:"smtp_port"`
SMTPUser string `toml:"smtp_user"`
SMTPPassword string `toml:"smtp_password"`
SMTPTLS bool `toml:"smtp_tls"`
Interpretator string `toml:"interpretator"`
Script string `toml:"script"`
}