metrics

package
v0.0.0-...-45f0f05 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cost

func Cost(utility Utility, chargePeriod Duration, pricePence float64)

func CostDelay

func CostDelay(utility Utility, readingTime time.Time)

func LiveUsage

func LiveUsage(utility Utility, valueWatts float64)

func MeterReading

func MeterReading(utility Utility, valueWatts float64, readingTime time.Time)

Types

type Duration

type Duration string
const (
	Day   Duration = "day"
	Week  Duration = "week"
	Month Duration = "month"
)

type Utility

type Utility string
const (
	Electricity Utility = "electricity"
	Gas         Utility = "gas"
)

Jump to

Keyboard shortcuts

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