model

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregation

type Aggregation struct {
	Value            decimal.Decimal `json:"value"`
	NormalizedPerDay decimal.Decimal `json:"normalizedPerDay"`
	Month            int             `json:"month"`
	Year             int             `json:"year"`
}

type Meter

type Meter struct {
	Name string `json:"name"`
	Unit string `json:"unit"`
}

type Reading

type Reading struct {
	ID      uint            `json:"id" gorm:"primary_key"`
	MeterId string          `json:"meterId"`
	Date    time.Time       `json:"date"`
	Value   decimal.Decimal `json:"value" sql:"type:decimal(10,3);"`
	Type    ReadingType     `json:"type"`
}

func FromCsv

func FromCsv(line []string) Reading

func (*Reading) ToCsv

func (r *Reading) ToCsv() []string

type ReadingType

type ReadingType int
const (
	MEASURE ReadingType = iota
	OFFSET
)

func ToReadingType

func ToReadingType(s string) (ReadingType, error)

func (ReadingType) ToString

func (r ReadingType) ToString() string

Jump to

Keyboard shortcuts

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