entities

package
v0.0.0-...-c0e0d3a Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: MPL-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elspotprice

type Elspotprice struct {
	HourUTC       pTime    `json:"HourUTC"`
	HourDK        pTime    `json:"HourDK"`
	PriceArea     string   `json:"PriceArea"`
	SpotPriceDKK  *float64 `json:"SpotPriceDKK"`
	DKKEstimated  bool     `json:"dkk_estimated"`
	EstimatedRate float64  `json:"rate,omitempty"`
	SpotPriceEUR  float64  `json:"SpotPriceEUR"`
	Typename      string   `json:"__typename"`
}

Elspotprice is the raw per price data

type FullPrice

type FullPrice struct {
	Taxes         []Tax     `json:"taxes"`
	ValidFrom     time.Time `json:"valid_from"`
	ValidTo       time.Time `json:"valid_to"`
	Estimated     bool      `json:"dkk_estimated"`
	EstimatedRate float64   `json:"rate,omitempty"`
	RawPrice      float64   `json:"spot_price_ex_vat"`
	TaxesSubTotal float64   `json:"taxes_subtotal_ex_vat"`
	Total         float64   `json:"total_ex_vat"`
	TotalIncVAT   float64   `json:"total_inc_vat"`
}

FullPrice is the final price per kWh, when all taxes are taken into account.

func (FullPrice) InWindow

func (fp FullPrice) InWindow(from, to time.Time) bool

InWindow returns true if fb is inside the window from - to

type IntSet

type IntSet map[int]struct{}

func NewIntSet

func NewIntSet(v ...int) IntSet

func (IntSet) Add

func (s IntSet) Add(v ...int)

func (IntSet) Contains

func (s IntSet) Contains(v int) bool

func (IntSet) Slice

func (s IntSet) Slice() []int

type Tariff

type Tariff struct {
	TariffId      interface{} `json:"tariffId"`
	Name          string      `json:"name"`
	Description   string      `json:"description"`
	Owner         string      `json:"owner"`
	PeriodType    string      `json:"periodType"`
	ValidFromDate string      `json:"validFromDate"`
	ValidToDate   *string     `json:"validToDate"`
	Price         float64     `json:"price"`
}

Tariff is a flattened version of a tariff from eloverblik.dk

func (Tariff) Tax

func (t Tariff) Tax() Tax

Tax converts a Tariff to a Tax

type TariffIndex

type TariffIndex map[int][]Tariff

func (TariffIndex) AtPos

func (t TariffIndex) AtPos(p int) Tariffs

AtPos returns the Tariff at index p, if it exists. Otherwise, returns from the default position (0)

type TariffMetadata

type TariffMetadata struct {
	PositionCount int
	Positions     IntSet
}

TariffMetadata contains information needed to properly duplicate data when default positions needs repeating alongside position specific data

type Tariffs

type Tariffs []Tariff

Tariffs is a slice of Tariff

func (Tariffs) Taxes

func (ts Tariffs) Taxes() Taxes

Taxes returns a list of taxes contained in ts

type Tax

type Tax struct {
	Name   string  `json:"name"`
	Amount float64 `json:"amount"`
}

Tax is a named tax with an amount (in DKK) per kWh

type Taxes

type Taxes []Tax

Taxes is a slice of Tax

func (Taxes) Total

func (ts Taxes) Total() float64

Total summarizes the values in ts

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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