water

package
v0.0.0-...-ecde165 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalyzeUsage

func AnalyzeUsage(ctx context.Context, report *Report, twoDayAvgMax, oneDayMax int, alerter Alerter) error

AnalyzeUsage does a simple analysis of maximum and 2 day avg water usage and alert if thresholds are crossed.

Types

type Alerter

type Alerter interface {
	Alert(ctx context.Context, msg string) error
}

Alerter notifies about alerts

type Record

type Record struct {
	Label string
	Value float64
}

type Report

type Report struct {
	LabelHeader string
	ValueHeader string
	Records     []Record
}

func DownloadDailyUsage

func DownloadDailyUsage(startDay, endDay time.Time, user, pass, acct string) (*Report, error)

DownloadDailyUsage returns a report of daily water usage data

func DownloadHourlyUsage

func DownloadHourlyUsage(start, end time.Time, user, pass, acct string) (*Report, error)

DownloadHourlyUsage returns a report of hourly water usage data

func (*Report) String

func (r *Report) String() string

Jump to

Keyboard shortcuts

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