notifier

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package notifier defines the event notification interface for PKI events.

The default implementation (SMTP mailer) is built into the core. Channel-specific implementations (Slack, DingTalk, Feishu, WeChat Work) have been extracted to the webhook satellite project.

Index

Constants

This section is empty.

Variables

View Source
var DefaultSMTPConfig = SMTPConfig{
	Port: 587,
}

Functions

func BuildMessage

func BuildMessage(from string, to []string, subject, body string) string

func ParseRecipients

func ParseRecipients(s string) []string

Types

type Mailer

type Mailer struct {
	// contains filtered or unexported fields
}

func NewMailer

func NewMailer(cfg SMTPConfig) *Mailer

func (*Mailer) Send

func (m *Mailer) Send(event, subject, body string) error

type Notifier

type Notifier interface {
	// Send sends a notification for the given event.
	Send(event, subject, body string) error
}

Notifier is the interface for sending event notifications. Implementations may deliver to email, chat, or any other channel.

type SMTPConfig

type SMTPConfig struct {
	Host               string `json:"host,omitempty"`
	Port               int    `json:"port,omitempty"`
	Username           string `json:"username,omitempty"`
	Password           string `json:"password,omitempty"`
	From               string `json:"from,omitempty"`
	To                 string `json:"to,omitempty"`
	TLS                bool   `json:"tls,omitempty"`
	InsecureSkipVerify bool   `json:"insecure_skip_verify,omitempty"`
	Events             string `json:"events,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL