discovery library
Control-plane discovery helpers.
See clientFromDiscovery for the easiest way to bootstrap a client that auto-discovers the correct data plane for the current user/tenant.
Classes
- CeDiscoveryEnvVars
- Environment variables used by local CE discovery.
- DiscoveryEnvVars
- Environment variables used by discovery.
- DiscoveryRecord
- A parsed discovery result.
Constants
- kDefaultLocalCePort → const int
- Self-hosted CE default loopback port.
- kDefaultLocalCeTarget → const String
- Default loopback gRPC target for a self-hosted CE server.
Functions
-
clientFromDiscovery(
{String? token, String? tenantHint, String? controlPlaneUrl, bool forceRefresh = false}) → Future< KumihoClient> - Creates a gRPC KumihoClient using Control Plane discovery.
-
clientFromLocalCe(
{Duration? timeout, Client? httpClient}) → Future< KumihoClient?> - Creates a tokenless KumihoClient for a loopback self-hosted CE server.
-
discoverTenant(
{String? controlPlaneUrl, String? firebaseToken, String? tenantHint, bool forceRefresh = false, Duration timeout = const Duration(seconds: 10), File? cacheFile}) → Future< DiscoveryRecord> - Resolves discovery info via Control Plane.
-
getDefaultDiscoveryCacheFile(
) → File -
resolveLocalCeEndpoint(
{Duration? timeout, Client? httpClient}) → Future< String?> - Resolves a loopback CE gRPC target when a local server advertises CE mode.
Exceptions / Errors
- CeDiscoveryError
- Raised when a CE environment variable is malformed.