Documentation
¶
Index ¶
- func LogFail(channel, reason string)
- func LogRetry(channel string, attempt, max int)
- func LogSuccess(channel, recipient string, duration time.Duration)
- func RenderTemplate(templateDir, templateName string, data any) (string, error)
- type ChannelType
- type Config
- type EmailProvider
- type Engine
- type Message
- type SMSProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogFail ¶
func LogFail(channel, reason string)
LogFail prints a failure message: [HERMES] ✗ Webhook failed: timeout
func LogSuccess ¶
LogSuccess prints a success message with timing: [HERMES] ✓ Email sent to admin@argus.tek (234ms)
Types ¶
type ChannelType ¶
type ChannelType string
ChannelType defines supported transport methods
const ( Email ChannelType = "email" SMS ChannelType = "sms" Webhook ChannelType = "webhook" )
type Config ¶
type Config struct {
Debug bool
MaxRetries int // Default: 0 (1 attempt, no retries)
EmailProvider EmailProvider // Inject Mailgun, AWS, or SMTP here
SMSProvider SMSProvider // Inject Twilio here
}
Config holds setup for the Hermes Engine
type EmailProvider ¶
EmailProvider defines the interface for sending emails
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) CheckHealth ¶
CheckHealth verifies external providers are reachable
type Message ¶
type Message struct {
Recipient string `json:"recipient"`
Subject string `json:"subject"` // Subject for Email, or Title for Push
Body string `json:"body"`
Channel ChannelType `json:"channel"`
Metadata map[string]string `json:"metadata,omitempty"` // Extra headers, webhook data, etc
}
Message is the generic payload for any notification
Click to show internal directories.
Click to hide internal directories.