push

package
v0.0.0-...-1d4e695 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 20 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 EventTemplateConfig

type EventTemplateConfig struct {
	Title, Msg string
}

EventTemplateConfig is the push message configuration 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(cc map[string]EventTemplateConfig, vv Vehicles, cache *util.Cache) (*Hub, error)

NewHub creates push hub with definitions and receiver

func (*Hub) Add

func (h *Hub) Add(sender Messenger)

Add adds a sender to the list of senders

func (*Hub) Run

func (h *Hub) Run(events <-chan Event, valueChan chan util.Param)

Run is the Hub's main publishing loop

type Messenger

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

Messenger implements message sending

func NewFromConfig

func NewFromConfig(typ string, other map[string]interface{}) (v Messenger, err error)

NewFromConfig creates messenger from configuration

func NewNtfyFromConfig

func NewNtfyFromConfig(other map[string]interface{}) (Messenger, error)

NewNtfyFromConfig creates new Ntfy messenger

func NewPushOverFromConfig

func NewPushOverFromConfig(other map[string]interface{}) (Messenger, error)

NewPushOverFromConfig creates new pushover messenger

func NewScriptFromConfig

func NewScriptFromConfig(other map[string]interface{}) (Messenger, error)

NewScriptFromConfig creates a Script messenger. Script execution is aborted after given timeout.

func NewShoutrrrFromConfig

func NewShoutrrrFromConfig(other map[string]interface{}) (Messenger, error)

NewShoutrrrFromConfig creates new Shoutrrr messenger

func NewTelegramFromConfig

func NewTelegramFromConfig(other map[string]interface{}) (Messenger, error)

NewTelegramFromConfig creates new pushover messenger

type Ntfy

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

Ntfy implements the ntfy messaging aggregator

func (*Ntfy) Send

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

Send sends to all receivers

type PushOver

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

PushOver implements the pushover messenger

func (*PushOver) Send

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

Send sends to all receivers

type Script

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

Script implements shell script-based message service and setters

func (*Script) Send

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

Send calls the script

type Shoutrrr

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

Shoutrrr implements the shoutrrr messaging aggregator

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 (*Telegram) Send

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

Send sends to all receivers

type Vehicles

type Vehicles interface {
	// ByName returns a single vehicle adapter by name
	ByName(string) (vehicle.API, error)
}

Jump to

Keyboard shortcuts

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