XweatherAuthenticator

Request authenticator used by WeatherService and source descriptors.

Builds signed headers / query params from account. Hosts typically use the instance on WeatherService.authenticator rather than constructing this type directly.

Parameters

account

Client credentials.

server

Token / API host (defaults to the MapsGL production server).

Constructors

Link copied to clipboard
constructor(account: XweatherAccount, server: URL)

Properties

Link copied to clipboard
Link copied to clipboard
open override val eventDispatcher: EventDispatcher
Link copied to clipboard
open override val headers: Map<String, String>
Link copied to clipboard

Functions

Link copied to clipboard

Template variables merged into tile / metadata URLs by com.xweather.mapsgl.utils.replaceVars. Use {accessKey} (id + _ + secret), {clientId}, or {clientSecret} in URL strings when the source sets com.xweather.mapsgl.sources.source.spec.VectorSourceDescriptor.authenticator (or other descriptors that carry the same authenticator).

Link copied to clipboard
open suspend override fun authenticate(): Map<String, String>
Link copied to clipboard
inline fun <EventType : Event> EventSource.publisher(eventType: Class<EventType>): Flow<EventType>
Link copied to clipboard
inline suspend fun <EventType : Event> EventSource.subscribe(eventType: Class<EventType>, crossinline handler: (EventType) -> Unit)
Link copied to clipboard