octopus

package
v0.0.0-...-175a4df Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ProductURI = "https://api.octopus.energy/v1/products/%s/"

ProductURI defines the location of the tariff information page. Substitute %s with tariff name.

View Source
const RatesURI = ProductURI + "electricity-tariffs/E-1R-%s-%s/standard-unit-rates/"

RatesURI defines the location of the full tariff rates page, including speculation. Substitute first %s with tariff name, second with region code.

Variables

This section is empty.

Functions

func ConstructRatesAPI

func ConstructRatesAPI(tariff string, region string) string

ConstructRatesAPI returns a validly formatted, fully qualified URI to the unit rate information.

Types

type Rate

type Rate struct {
	ValidityStart     time.Time `json:"valid_from"`
	ValidityEnd       time.Time `json:"valid_to"`
	PriceInclusiveTax float64   `json:"value_inc_vat"`
	PriceExclusiveTax float64   `json:"value_exc_vat"`
}

type UnitRates

type UnitRates struct {
	Count    uint64 `json:"count"`
	Next     string `json:"next"`
	Previous string `json:"previous"`
	Results  []Rate `json:"results"`
}

Jump to

Keyboard shortcuts

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