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
Client is an interface for a notification client
func NewPushover ¶ added in v0.2.0
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
NewNotifier returns an initialized *Notifier
func (*Notifier) Notify ¶ added in v0.2.0
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
Click to show internal directories.
Click to hide internal directories.