notify

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.2.0

type Client interface {
	Notify(message string) bool
}

Client is an interface for a notification client

func NewPushover added in v0.2.0

func NewPushover(token, user string) Client

NewPushover returns a client interface for a pushover client

type Notifier added in v0.2.0

type Notifier struct {
	CurrentBestStations  map[fueltype]station.StationMap
	NotifiedBestStations map[fueltype]station.StationMap
	GoodPrice            map[fueltype]float64
	// contains filtered or unexported fields
}

Notifier represents a notifier struct with information about best stations and last notifications

func NewNotifier added in v0.2.0

func NewNotifier(client Client) *Notifier

NewNotifier returns an initialized *Notifier

func (*Notifier) Notify added in v0.2.0

func (n *Notifier) Notify() bool

Notify will send a notification if there are best stations available currently Returns if a message was send

func (*Notifier) UpdateBestStations added in v0.2.0

func (n *Notifier) UpdateBestStations(fuel string, goodPrice float64, bestStations station.StationMap)

UpdateBestStations updates the best stations of the Notifier

type PushoverClient added in v0.2.0

type PushoverClient struct {
	Token     string
	User      string
	App       *pushover.Pushover
	Recipient *pushover.Recipient
}

PushoverClient represents a notification client for Pushover

func (*PushoverClient) Notify added in v0.2.0

func (p *PushoverClient) Notify(message string) bool

Notify will send a notification via Pushover returns if the message was send without failure

Jump to

Keyboard shortcuts

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