eloverblik

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAuth = errors.New("authorization error")

Functions

func PreloadTariffs

func PreloadTariffs(c interfaces.Configurator) error

Types

type Eloverblik

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

Eloverblik implements the interfaces for getting tariffs

func (*Eloverblik) Authenticate

func (e *Eloverblik) Authenticate(token []byte) error

func (*Eloverblik) ExecAuth

func (e *Eloverblik) ExecAuth() error

ExecAuth performs the actual authentication step and stores/refreshes the refresh token

func (Eloverblik) FullTariffs

func (e Eloverblik) FullTariffs() FullTariffs

func (*Eloverblik) Identify

func (e *Eloverblik) Identify(mid []byte) error

func (*Eloverblik) Query

func (e *Eloverblik) Query() (interface{}, error)

type FullTariffs

type FullTariffs struct {
	Result []struct {
		Result struct {
			MeteringPointId string `json:"meteringPointId"`
			Subscriptions   []struct {
				SubscriptionId interface{} `json:"subscriptionId"`
				Name           string      `json:"name"`
				Description    string      `json:"description"`
				Owner          string      `json:"owner"`
				ValidFromDate  string      `json:"validFromDate"`
				ValidToDate    interface{} `json:"validToDate"`
				Price          float64     `json:"price"`
				Quantity       int         `json:"quantity"`
			} `json:"subscriptions"`
			Fees    []interface{} `json:"fees"`
			Tariffs []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"`
				Prices        []struct {
					Position string  `json:"position"`
					Price    float64 `json:"price"`
				} `json:"prices"`
			} `json:"tariffs"`
		} `json:"result"`
		Success       bool        `json:"success"`
		ErrorCode     int         `json:"errorCode"`
		ErrorCodeEnum string      `json:"errorCodeEnum"`
		ErrorText     string      `json:"errorText"`
		Id            string      `json:"id"`
		StackTrace    interface{} `json:"stackTrace"`
	} `json:"result"`
	// contains filtered or unexported fields
}

FullTariffs is the data format returned from eloverblik, containg tariff information.

var FullTariffsCached FullTariffs

func (FullTariffs) Index

func (ft FullTariffs) Index() entities.TariffIndex

Index tariffs by position (hour)

func (FullTariffs) UpdatedAt

func (ft FullTariffs) UpdatedAt() time.Time

type RequestData

type RequestData struct {
	MeteringPoints struct {
		MeteringPoint []string `json:"meteringPoint"`
	} `json:"meteringPoints"`
}

RequestData is the meetring data (mid) sent to eloverblik for extracting tariffs

Jump to

Keyboard shortcuts

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