push

package
v0.0.0-...-e6e1b3f Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	LoadPoint *int // optional loadpoint id
	Event     string
}

Event is a notification event

type EventTemplate

type EventTemplate struct {
	Title, Msg string
}

EventTemplate is the push message template for an event

type Hub

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

Hub subscribes to event notifications and sends them to client devices

func NewHub

func NewHub(definitions map[string]EventTemplate, cache *util.Cache) *Hub

NewHub creates push hub with definitions and receiver

func (*Hub) Add

func (h *Hub) Add(sender Sender)

Add adds a sender to the list of senders

func (*Hub) Run

func (h *Hub) Run(events <-chan Event)

Run is the Hub's main publishing loop

type PushOver

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

PushOver implements the pushover messenger

func NewPushOverMessenger

func NewPushOverMessenger(app string, recipients []string) (*PushOver, error)

NewPushOverMessenger creates new pushover messenger

func (*PushOver) Send

func (m *PushOver) Send(title, msg string)

Send sends to all receivers

type Sender

type Sender interface {
	Send(title, msg string)
}

Sender implements message sending

func NewMessengerFromConfig

func NewMessengerFromConfig(typ string, other map[string]interface{}) (res Sender, err error)

NewMessengerFromConfig creates a new messenger

type Shoutrrr

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

Shoutrrr implements the shoutrrr messaging aggregator

func NewShoutrrrMessenger

func NewShoutrrrMessenger(uri string) (*Shoutrrr, error)

NewShoutrrrMessenger creates new Shoutrrr messenger

func (*Shoutrrr) Send

func (m *Shoutrrr) Send(title, msg string)

Send sends to all receivers

type Telegram

type Telegram struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Telegram implements the Telegram messenger

func NewTelegramMessenger

func NewTelegramMessenger(token string, chats []int64) (*Telegram, error)

NewTelegramMessenger creates new pushover messenger

func (*Telegram) Send

func (m *Telegram) Send(title, msg string)

Send sends to all receivers

Jump to

Keyboard shortcuts

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