blutspende

package
v0.0.0-...-d8edaa1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UrlApi              = "https://balu-api.ukaachen.de/v1"
	UrlApiLocations     = UrlApi + "/locations"
	UrlApiDonationDates = UrlApi + "/donationdates"
	UrlSpendePegelStat  = UrlApi + "/spendepegel-stat"
)

Variables

This section is empty.

Functions

func FetchPegel

func FetchPegel(c *colly.Collector, cb func(p SpendePegelStats), ecb cfac.ErrorCallback) *sync.WaitGroup

func NewMeasurable

func NewMeasurable() cfac.Measurable

Types

type DonationDate

type DonationDate struct {
	ID              int       `json:"id"`
	Date            time.Time `json:"date"`
	FreePlacesCount int       `json:"freePlacesCount"`
	Location        Location  `json:"location"`
	Slots           []Slot    `json:"slots"`
}

type Location

type Location struct {
	ID          int     `json:"id"`
	Label       string  `json:"label"`
	Name        string  `json:"name"`
	Address     string  `json:"address"`
	GeoAddress  string  `json:"geoAddress"`
	Latitude    float64 `json:"latitude"`
	Longitude   float64 `json:"longitude"`
	Description struct {
		Md string `json:"md"`
	} `json:"description"`
}

type Measurable

type Measurable struct{}

func (*Measurable) Fetch

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

type ResponseDonationDates

type ResponseDonationDates []DonationDate

type ResponseLocations

type ResponseLocations []Location

type ResponseSpendePegelStats

type ResponseSpendePegelStats struct {
	Fill  float64 `json:"fill"`
	Label string  `json:"label"`
}

type Slot

type Slot struct {
	Key     string `json:"key"`
	Enabled bool   `json:"enabled"`
	Hour    int    `json:"hour"`
	Minute  int    `json:"minute"`
}

type SpendePegelStats

type SpendePegelStats struct {
	FillPercentage float64
	Donations      int
	LastUpdated    time.Time
}

func (*SpendePegelStats) Measure

func (p *SpendePegelStats) Measure() cfac.Measurement

Jump to

Keyboard shortcuts

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