Documentation
¶
Overview ¶
Package withings is the worker for Withings: it talks to the Withings API for the backend. It plays the scale-source role (see pkg/shared/workerapi): "withings.connect" exchanges the code the user got when they allowed access, and "withings.import" fetches their measurements.
The worker has no database. The application's credentials and the user's tokens come with each job; a token pair the worker renews is handed back with SaveCredentials before it is used, because a Withings refresh token works once and losing the new pair disconnects the user. What to store is decided by the backend: this package only fetches and maps.
Index ¶
Constants ¶
const ( KindConnect = Provider + "." + workerapi.ActionConnect // same as workerapi.Kind(Provider, workerapi.ActionConnect) KindImport = Provider + "." + workerapi.ActionImport )
The kinds this worker runs.
const Provider = workerapi.ProviderWithings
Provider is the provider's name: the first part of its kinds and the readings' Source.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// APIBase overrides the Withings API address (used by tests).
APIBase string
}
Config holds what only a test changes; the application's credentials come with every job.