notify

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSendNotification = errors.New("notify: could not send notification")

ErrSendNotification is returned when a notification could not be sent.

Functions

This section is empty.

Types

type Config

type Config struct {
	DeviceTokens []string
}

Config is the configuration for a notifier.

type Notifier

type Notifier interface {
	Notify(ctx context.Context, title, message string, config ...Config) error
}

Notifier is an interface for sending notifications.

type Notify

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

Notify sends a notification with the given title and message.

func New

func New(opts ...Opt) *Notify

New creates a new Notify.

func (*Notify) Notify

func (n *Notify) Notify(ctx context.Context, title, message string, config ...Config) error

Notify sends a notification with the given title and message.

type Opt

type Opt func(*Notify)

Opt is a functional option for configuring Notify.

func WithNotifiers

func WithNotifiers(notifiers ...Notifier) Opt

WithNotifiers sets the notifiers to use.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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