push

package
v0.0.0-...-fe68c91 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 24 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 NewConfigurableFromConfig

func NewConfigurableFromConfig(ctx context.Context, other map[string]interface{}) (Messenger, error)

NewConfigurableFromConfig creates Messenger from config

func NewFromConfig

func NewFromConfig(ctx context.Context, typ string, other map[string]interface{}) (Messenger, 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 NewShoutrrrFromConfig

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

NewShoutrrrFromConfig creates new Shoutrrr messenger

func NewTelegramFromConfig

func NewTelegramFromConfig(ctx context.Context, 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 Push

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

Push is a configurable Messenger implementation

func NewConfigurable

func NewConfigurable(send func(string) error, encoding string) (*Push, error)

NewConfigurable creates a new Messenger

func (*Push) Send

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

Send implements the Messenger interface

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 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