OpenParking Documentation Beta

Protocol Datasource

public protocol Datasource

Requirements

name

var name: String

The source's canonical name.

slug

var slug: String

The source's name as a URL-compatible slug.

info​URL

var infoURL: URL

URL pointing to a description of the data, not necessarily where the live data is accessed from.

contributor

var contributor: String?

Attribution data for the contributor of the source.

attribution​URL

var attributionURL: URL?

URL pointing to more information regarding the contribution of the source.

license

var license: String?

A license under which this source is being published.

data()

func data() throws -> DataPoint

Entrypoint for gathering current data.

This function can throw errors to indicate that data collection has failed entirely and can not be continued. Please use the DataPoint's LotResult to indicate for failures for specific lots or warn(_:lotName:) for indicating issues that do not indicate that data collection has failed.