Documentation
¶
Index ¶
- func GetAllSchemas() map[string]any
- func GetEmailNotifySchema() interface{}
- func GetWebhookNotifySchema() interface{}
- func RegisterSchema(name string, schema any)
- type EmailMessenger
- type EmailNotifyConfig
- type EventType
- type FlowExecutionEvent
- type GroupResolver
- type Message
- type Messenger
- type WebhookMessenger
- type WebhookNotifyConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllSchemas ¶ added in v0.8.0
GetAllSchemas returns a map of all registered messenger names to their config schemas.
func GetEmailNotifySchema ¶ added in v0.8.0
func GetEmailNotifySchema() interface{}
func GetWebhookNotifySchema ¶ added in v0.8.0
func GetWebhookNotifySchema() interface{}
func RegisterSchema ¶ added in v0.8.0
RegisterSchema registers a messenger's config schema. Panics on duplicate.
Types ¶
type EmailMessenger ¶
type EmailMessenger struct {
// contains filtered or unexported fields
}
EmailMessenger sends emails using an SMTP connection pool
func NewEmailMessenger ¶
func NewEmailMessenger(cfg config.SMTPConfig, groupResolver GroupResolver, logger *slog.Logger, rootURL string) (*EmailMessenger, error)
NewEmailMessenger creates a new EmailMessenger with the given SMTP configuration
func (*EmailMessenger) Close ¶
func (e *EmailMessenger) Close()
Close closes the SMTP connection pool
type EmailNotifyConfig ¶ added in v0.8.0
type EmailNotifyConfig struct {
Receivers []string `json:"receivers" jsonschema:"title=Recipients,description=Users or groups to notify" jsonschema_extras:"widget=userselector"`
}
EmailNotifyConfig defines the messenger-specific configuration schema for email notifications.
type EventType ¶ added in v0.8.0
type EventType string
EventType identifies the kind of event a Message carries.
const (
EventFlowExecution EventType = "flow.execution"
)
type FlowExecutionEvent ¶ added in v0.8.0
type FlowExecutionEvent struct {
FlowID string `json:"flow_id"`
FlowName string `json:"flow_name"`
ExecID string `json:"exec_id"`
Status string `json:"status"`
Error string `json:"error"`
Namespace string `json:"namespace"`
RootURL string `json:"-"`
}
FlowExecutionEvent carries structured data about a flow execution state change.
type GroupResolver ¶ added in v0.8.0
type GroupResolver interface {
ResolveGroupEmails(ctx context.Context, groupName string) ([]string, error)
}
GroupResolver resolves a group name to a list of member email addresses.
type WebhookMessenger ¶ added in v0.8.0
type WebhookMessenger struct {
// contains filtered or unexported fields
}
WebhookMessenger sends HTTP POST requests using the Standard Webhooks format.
func NewWebhookMessenger ¶ added in v0.8.0
func NewWebhookMessenger(cfg config.WebhookConfig, logger *slog.Logger) (*WebhookMessenger, error)
NewWebhookMessenger creates a new WebhookMessenger with the given configuration.
func (*WebhookMessenger) Close ¶ added in v0.8.0
func (w *WebhookMessenger) Close()
Close is a no-op for the webhook messenger.
type WebhookNotifyConfig ¶ added in v0.8.0
type WebhookNotifyConfig struct {
URL string `json:"url" jsonschema:"title=Webhook URL,description=URL to POST webhook notifications to"`
}
WebhookNotifyConfig defines the per-flow webhook configuration rendered in the UI.