internal

package
v1.0.62 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPrices = errors.New("prices not yet available")

Functions

func AddCharges

func AddCharges(price float64) float64

Returns the price in Euros per kWh, including VAT.

func FormatCurrencyValue

func FormatCurrencyValue(value float64) string

func GetGreeting

func GetGreeting(t time.Time) (hello, goodbye string)

func GetPriceEmoji

func GetPriceEmoji(price, average float64) string

func PrepareQueryParameters

func PrepareQueryParameters() string

Types

type EnergyPrices

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

func GetEnergyPrices

func GetEnergyPrices(log *slog.Logger) (*EnergyPrices, error)

func NewEnergyPrices added in v1.0.60

func NewEnergyPrices(prices []Price) *EnergyPrices

func (*EnergyPrices) Average

func (e *EnergyPrices) Average() float64

func (*EnergyPrices) AverageHours

func (e *EnergyPrices) AverageHours() []int

func (*EnergyPrices) Get added in v1.0.60

func (e *EnergyPrices) Get(hour int) (float64, bool)

func (*EnergyPrices) High

func (e *EnergyPrices) High() float64

func (*EnergyPrices) HighHours

func (e *EnergyPrices) HighHours() []int

func (*EnergyPrices) Low

func (e *EnergyPrices) Low() float64

func (*EnergyPrices) LowHours

func (e *EnergyPrices) LowHours() []int

type Price

type Price struct {
	Hour  int
	Price float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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