Documentation
¶
Overview ¶
Package notify provides a generic interface to send user notifications. The actual transport behind (mail, webhook) can be plugged in as needed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteHTMLTemplate ¶
ExecuteHTMLTemplate invokes [htmltemplat.Execute] using the given template text and parameter object.
Types ¶
type LogPayload ¶
type NamedValue ¶
NamedValue represents a named value pair as found in a parameter object.
func DecodeParams ¶
func DecodeParams(params any) ([]NamedValue, error)
DecodeParams decodes a struct object to the contained NamedValue pairs. If the params object is nil, an empty array is returned.
type Payload ¶
type Payload[T any] interface { // Send sends the Payload after applying the given params object. Send(ctx context.Context, params any) error }
Payload represents a single notification including content and transport specific attributes.
type PayloadRegistry ¶
type PayloadRegistry[T any] struct { // contains filtered or unexported fields }
PayloadRegistry represents a registry of named Payloads and by this a single location to store and access the notifications of an application.