Documentation
¶
Overview ¶
Package notify delivers expiry, renewal and revocation events to webhooks, SMTP, Slack and Telegram. Delivery is best-effort: a channel that is down must never block or fail the PKI operation that triggered it.
Index ¶
Constants ¶
View Source
const ( EventCertificateExpiring = "certificate.expiring" EventCertificateExpired = "certificate.expired" EventCertificateRenewed = "certificate.renewed" EventCertificateRevoked = "certificate.revoked" EventCertificateIssued = "certificate.issued" EventAuthorityExpiring = "authority.expiring" EventRenewalFailed = "renewal.failed" EventTest = "test" )
Event names channels can subscribe to. "*" matches every event.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct {
Type string `json:"event"`
Title string `json:"title"`
Message string `json:"message"`
Severity string `json:"severity"`
Timestamp time.Time `json:"timestamp"`
Data map[string]any `json:"data,omitempty"`
}
Event is one notification payload.
type SMTP ¶
type SMTP struct {
Host string
Port int
Username string
Password string
From string
To []string
// TLS selects the transport: "starttls" (default), "tls" for implicit TLS,
// or "none" for a plaintext relay on a trusted network.
TLS string
// InsecureSkipVerify disables certificate verification. It exists because
// a private PKI is often bootstrapped against a mail server whose
// certificate this very instance has not yet issued.
InsecureSkipVerify bool
}
SMTP sends the event as an email.
type Telegram ¶
type Telegram struct {
BotToken string
ChatID string
// ThreadID targets one topic inside a forum-style supergroup. Empty sends
// to the general thread.
ThreadID string
// Silent delivers without a notification sound.
Silent bool
// APIBaseURL overrides the public Bot API root, for a self-hosted server.
APIBaseURL string
}
Telegram sends the event to a chat through a bot.
Click to show internal directories.
Click to hide internal directories.