convert

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnitMapping = map[string]*UnitConversion{
	"GigawattHour": {
		Unit:    "KilowattHour",
		Scaling: 1000000,
	},
}

UnitMapping maps unit schemas with scaling factor.

Functions

func ToLegacyResult added in v1.33.0

func ToLegacyResult(input *pb.GetTriplesResponse) map[string][]*model.Triple

ToLegacyResult converts pb.GetTriplesResponse to legacy golang struct to make the API response backward compatible.

func ToObsCollection

func ToObsCollection(token string, jsonRaw []byte) (interface{}, error)

ToObsCollection converts ChartStore to pb.ObsCollection

func ToObsSeries

func ToObsSeries(token string, jsonRaw []byte) (interface{}, error)

ToObsSeries converts ChartStore to ObsSeries

func ToObsSeriesPb

func ToObsSeriesPb(token string, jsonRaw []byte) (interface{}, error)

ToObsSeriesPb converts ChartStore to pb.ObsTimeSerie

func ToTriples added in v1.33.0

func ToTriples(dcid string, jsonRaw []byte) (interface{}, error)

ToTriples converts raw bigtable data to pb.Triples

Types

type UnitConversion

type UnitConversion struct {
	Unit    string
	Scaling float64
}

UnitConversion represents conversion sepc for units.

Jump to

Keyboard shortcuts

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