Something went wrong

Thank you for being patient! We're working hard on resolving the issue

Connector module - Lona Docs Log in

Weather connector module

Behind features = ["connector"]. Maps the :~weather:{lid} and :~weather:{lid}:logs rowkey families.

What's exposed

tento_weather::connector::{
  Weather,                   // Integration + Row (single-pattern)
  WeatherClient,             // grab-bag (WeatherBackend handle)
  WeatherBackend,            // host-impl trait (sync_location, query_range)
  WeatherBackendDeps,        // host-impl seam → WeatherBackend
  WeatherParams,             // path params (locationId, alias lid)
  logs::{Logs, WeatherLogsDeps, LogsParams},
}

Weather is unusual in three ways:

  1. System-tier rows. All :~weather:{lid} rows are owned by a host-supplied system account, surfaced via WeatherLogsDeps::weather_system_owner(). Individual users see weather via row aliases, not by owning the row themselves.
  2. No per-user auth. Integration::client ignores user; the provider API key lives in env config, threaded into the host's WeatherBackend impl.
  3. Flat shape. :~weather:{locationId} is a single pattern — Weather doubles as both Integration + Row.

WeatherBackend (host-impl)

#[async_trait]
pub trait WeatherBackend: Send + Sync {
  async fn sync_location(&self, location_id: i32) -> anyhow::Result<usize>;
  async fn query_range(
    &self,
    location_id: i32,
    range: Range<NaiveDate>,
  ) -> anyhow::Result<Vec<Cell>>;
}

The host implements this against its real weather store. The Row body's sync calls sync_location and list_cells calls query_range.

WeatherLogsDeps (host-impl)

pub trait WeatherLogsDeps: Send + Sync {
  fn weather_system_owner(&self) -> Owner;

  fn recent_log_cells<'a>(
    &'a self,
    owner: &'a Owner,
    lookup_key: &'a str,
  ) -> BoxFuture<'a, anyhow::Result<Vec<Cell>>>;
}

weather_system_owner is the only host-supplied owner string in the connector. The host returns its canonical system-owner identifier.