Help us shape the future of Go! Take the 2026 Go Developer Survey

notify

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSendTimeout = 15 * time.Second

Variables

This section is empty.

Functions

func BuildURL

func BuildURL(input DestinationInput) (string, error)

func ConfigureHTTPClient added in v0.30.0

func ConfigureHTTPClient(timeout time.Duration, allowPrivateTargets bool)

ConfigureHTTPClient installs the bounded client used by Shoutrrr's HTTP services. Redirects are checked again so a public endpoint cannot redirect a notification into a private network.

func RedactError added in v0.23.0

func RedactError(err error) string

RedactError removes service URLs and common credential query parameters from provider errors before they are persisted or shown in the admin audit. The underlying error remains available to the caller for retry decisions, but destination credentials never become application-log or database content.

Types

type DestinationInput

type DestinationInput struct {
	Service  string
	RawURL   string
	Host     string
	Port     string
	Username string
	Password string
	Token    string
	Target   string
	From     string
	To       string
	Topic    string
}

type NotificationSender

type NotificationSender interface {
	Validate(string) error
	Send(context.Context, string, string, string) error
}

type ShoutrrrSender

type ShoutrrrSender struct {
	// AllowPrivateTargets is an explicit opt-in for self-hosted notification
	// services on a trusted LAN. It is disabled by default to keep a member
	// supplied destination from turning the application into an SSRF proxy.
	AllowPrivateTargets bool
	// SendTimeout bounds HTTP-based notification providers. Shoutrrr uses the
	// process-wide net/http client for several services, so this timeout also
	// protects those providers from hanging forever.
	SendTimeout time.Duration
	// contains filtered or unexported fields
}

func (ShoutrrrSender) Send

func (s ShoutrrrSender) Send(ctx context.Context, serviceURL, title, body string) error

func (ShoutrrrSender) Validate

func (s ShoutrrrSender) Validate(serviceURL string) error

Jump to

Keyboard shortcuts

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