apag

package
v0.0.0-...-441f3cd Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Url        = "https://www.apag.de"
	UrlApi     = Url + "/qad_restAPI.php"
	UrlChartXS = UrlApi + "?q={ident}&d=chartxs&max={max}"
)

Variables

This section is empty.

Functions

func FetchAllHouseStats

func FetchAllHouseStats(c *colly.Collector, cb func([]Stats), ecb cfac.ErrorCallback) *sync.WaitGroup

func FetchAllHouses

func FetchAllHouses(c *colly.Collector, cb func([]House), ecb cfac.ErrorCallback) *sync.WaitGroup

func FetchHouseStats

func FetchHouseStats(c *colly.Collector, ident string, cb func(Stats), ecb cfac.ErrorCallback) *sync.WaitGroup

func FetchHousesWithStats

func FetchHousesWithStats(c *colly.Collector, cb func(House), ecb cfac.ErrorCallback) *sync.WaitGroup

func NewMeasurable

func NewMeasurable() cfac.Measurable

Types

type CustomTime

type CustomTime struct {
	time.Time
}

func (*CustomTime) UnmarshalJSON

func (c *CustomTime) UnmarshalJSON(b []byte) error

type House

type House struct {
	NID       uint    `json:"nid,string"`
	Ident     string  `json:"ident"`
	Url       string  `json:"url"`
	Title     string  `json:"title"`
	Latitude  float32 `json:"lat,string"`
	Longitude float32 `json:"lon,string"`
	Capacity  uint    `json:"capacity,string"`
	Open      string  `json:"open"`
	Height    string  `json:"height"`
	Type      string  `json:"type"`

	Stats *Stats
}

func (*House) FetchStats

func (h *House) FetchStats(c *colly.Collector, cb func(Stats), ecb cfac.ErrorCallback) *sync.WaitGroup

func (*House) Measure

func (h *House) Measure() cfac.Measurement

type Measurable

type Measurable struct{}

func (*Measurable) Fetch

func (m *Measurable) Fetch(c *colly.Collector, cb cfac.MeasurementCallback, ecb cfac.ErrorCallback) *sync.WaitGroup

type Stats

type Stats struct {
	Ident   string     `json:"ident"`
	Date    CustomTime `json:"date"`
	Max     uint       `json:"max,string"`
	Percent float32    `json:"percent,string"`
	Count   uint       `json:"count,string"`
	Free    uint       `json:"free,string"`
	Full    int        `json:"full,string"`
	Trend   string     `json:"trend"`
}

Jump to

Keyboard shortcuts

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