baths

package module
v0.0.0-...-89db0c7 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Unlicense Imports: 6 Imported by: 0

README

Zürich Baths

Client to query open data about public open-air baths in Zürich.

Usage

import baths "github.com/coffeemakr/zuerich-baths"

baths, err := baths.GetBaths()
if err != nil {
    fmt.Printf("Fehler: Konnte nicht geladen werden.\nMehr Infos: %s", err)
    os.Exit(1)
}

for _, bath := range baths {
    fmt.Printf("%-30s: %2.1f°C\n", bath.Name, bath.WaterTemperature)
}

Client

There is a CLI just for fun.

Screenshot of the command line interface

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZuerichBathApiClient

type ZuerichBathApiClient struct {
	Client *http.Client
}

func (ZuerichBathApiClient) GetBaths

func (a ZuerichBathApiClient) GetBaths() ([]*ZuerichBaths, error)

GetBaths returns a list of public open-air baths in Zürich

type ZuerichBaths

type ZuerichBaths struct {
	Name                string      `xml:"title"`
	WaterTemperature    float32     `xml:"temperatureWater"`
	PoiID               string      `xml:"poiid"`
	DateModified        zuerichTime `xml:"dateModified"`
	OpenClosedTextPlain string      `xml:"openClosedTextPlain"`
	URLPage             string      `xml:"urlPage"`
	//PathPage                  string `xml:"pathPage"`
	URLAddressAndOpeningHours string `xml:"urlAddressAndOpeningHours"`
}

func GetBaths

func GetBaths() ([]*ZuerichBaths, error)

GetBaths returns a list of public open-air baths in Zürich using the default API client

func (ZuerichBaths) String

func (b ZuerichBaths) String() string

Jump to

Keyboard shortcuts

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