Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MaxRetryAttempts is the ceiling on delivery attempts (initial try plus // retries) enforced both at configuration time and at delivery time. MaxRetryAttempts = maxRetryAttempts )
Variables ¶
This section is empty.
Functions ¶
func ValidateTemplate ¶
Verifies a template string parses and produces valid JSON when rendered with sample data
Types ¶
type Config ¶
type Config struct {
URL string `json:"url"`
Secret string `json:"secret"`
PayloadTemplate string `json:"payload_template"`
Headers map[string]string `json:"headers"`
MaxRetries int `json:"max_retries"`
RetryDelayMs int `json:"retry_delay_ms"`
TimeoutMs int `json:"timeout_ms"`
}
Controls a single webhook delivery - built from json config blob on webhook task
type Payload ¶
type Payload struct {
Event string `json:"event"`
Timestamp time.Time `json:"timestamp"`
Server *ServerPayload `json:"server,omitempty"`
Data map[string]any `json:"data,omitempty"`
}
Canonical event data fed into payload templates
type Result ¶
type Result struct {
Success bool
ResponseCode int
ResponseBody string
ErrorMessage string
DurationMs int64
Attempts int
}
A single delivery attempt outcome
type ServerPayload ¶
type ServerPayload struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
MCVersion string `json:"mc_version"`
ModLoader string `json:"mod_loader"`
Players int `json:"players_online"`
MaxPlayers int `json:"max_players"`
Port int `json:"port"`
}
Server snapshot embedded in a webhook payload
Click to show internal directories.
Click to hide internal directories.