notifier

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncodingForm encoding = "application/x-www-form-urlencoded"
	EncodingJson encoding = "application/json"
)

Variables

This section is empty.

Functions

func BroadcastNotification

func BroadcastNotification(amount uint64, comment string)

func SetupNotifiers

func SetupNotifiers(notifierConfigs []Config, logger btclog.Logger)

Types

type Config

type Config struct {
	Type      string
	MinAmount uint64
	Params    map[string]string
}

type HttpNotifier

type HttpNotifier struct {
	Cfg          Config
	URL          string
	Method       string
	Encoding     encoding
	BodyTemplate string
}

func NewHttpNotifier

func NewHttpNotifier(cfg Config) *HttpNotifier

func (*HttpNotifier) Notify

func (h *HttpNotifier) Notify(amount uint64, comment string) error

func (*HttpNotifier) Target

func (h *HttpNotifier) Target() string

type MailNotifier

type MailNotifier struct {
	Cfg       Config
	To        string
	From      string
	Server    string
	Login     string
	Password  string
	MinAmount uint64
}

func NewMailNotifier

func NewMailNotifier(cfg Config) *MailNotifier

func (*MailNotifier) Notify

func (m *MailNotifier) Notify(amount uint64, comment string) (err error)

func (*MailNotifier) Target

func (m *MailNotifier) Target() string

type Notifier

type Notifier interface {
	Notify(amount uint64, comment string) error
	Target() string
}

type SignalNotifier

type SignalNotifier struct {
	Cfg       Config
	FromPhone string
	ToPhone   string
	MinAmount uint64
}

func NewSignalNotifier

func NewSignalNotifier(cfg Config) *SignalNotifier

func (*SignalNotifier) Notify

func (s *SignalNotifier) Notify(amount uint64, comment string) error

func (*SignalNotifier) Target

func (s *SignalNotifier) Target() string

type TelegramNotifier

type TelegramNotifier struct {
	Cfg       Config
	ChatId    int64
	Token     string
	MinAmount uint64
}

func NewTelegramNotifier

func NewTelegramNotifier(cfg Config) *TelegramNotifier

func (*TelegramNotifier) Notify

func (t *TelegramNotifier) Notify(amount uint64,
	comment string) (err error)

func (*TelegramNotifier) Target

func (t *TelegramNotifier) Target() string

Jump to

Keyboard shortcuts

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