decorator

package
v0.0.0-...-616478d Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggingNotifier

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

LoggingNotifier adds logging to any notifier

func WithLogging

func WithLogging(notifier notif.Notifier, logger *log.Logger) *LoggingNotifier

WithLogging wraps a notifier with logging.

Should be placed right after base notifier as the Name() of prior notifier is used when logging.

func (*LoggingNotifier) Name

func (l *LoggingNotifier) Name() string

func (*LoggingNotifier) Send

func (l *LoggingNotifier) Send(ctx context.Context, msg notif.Message) error

Send sends a notification with logging

type RetryNotifier

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

RetryNotifier adds retry logic to any notifier

func WithRetry

func WithRetry(notifier notif.Notifier, maxRetries int, retryDelay, maxRetryDelay time.Duration) *RetryNotifier

WithRetry wraps a notifier with retry logic

func (*RetryNotifier) Name

func (r *RetryNotifier) Name() string

func (*RetryNotifier) Send

func (r *RetryNotifier) Send(ctx context.Context, msg notif.Message) error

Send sends a notification with retry logic

Jump to

Keyboard shortcuts

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