lantern_client library
Official pure-Dart types and mobile transport foundation for Lantern clients.
Generated service and replication internals remain private to the package; CRUD and query facades are layered on the reusable LanternClient.
Search projection, analysis, ranking, TTL, typed-error, cursor, and HA semantics are canonical at https://github.com/anaregdesign/lantern/blob/main/docs/search.md.
Classes
- AddEdgesResult
- Result of a plural additive edge write.
- BfsOptions
- Greedy, per-hop top-k BFS options.
- BoolValue
- A boolean vertex value.
- BytesValue
- A defensively owned byte-string vertex value.
- CausalMetadataKindStatus
- Per-kind HA causal-identity capacity and retention snapshot.
- CausalMetadataStatus
- Vertex and edge shares of the retained HA causal-identity budget.
- DecayOptions
- Geometric staircase parameters for LanternDecay.addDecayingEdge.
- DegreeEntry
- One immutable degree-ranked vertex.
- DurationValue
- A Protobuf Duration vertex value.
- Edge
- Immutable SDK-facing edge.
- EdgeInput
- Input for additive or idempotent edge writes.
- EdgePutResult
- Result of one edge Put, including its request identity.
- EdgeRef
- Immutable edge identity.
- Float32Value
-
A Protobuf
floatvertex value. - Float64Value
-
A Protobuf
doublevertex value. - GetEdgesResult
- Present and missing edges from a plural read.
- GetVerticesResult
- Present and missing vertices from a plural read.
- Graph
- Immutable Illuminate result that retains complete Edge values and TTLs.
- IncrementalSearch
- Screen-owned, latest-query-wins search-as-you-type session.
- IncrementalSearchOptions
- Configuration for a pure-Dart incremental search session.
- Int32Value
- A signed 32-bit vertex value.
- Int64Value
- A signed 64-bit vertex value.
- LanternCallOptions
- Per-call deadline, cancellation, and retry overrides.
- LanternCancellationToken
- Caller-controlled cancellation shared by unary and streaming RPCs.
- LanternClient
- Reusable Android/iOS-first Lantern client foundation.
- LocalCommunityOptions
- PageRank-Nibble local-community options.
- NilValue
- The explicit nil oneof arm.
-
Page<
T> - One bounded scan page with an explicit continuation boundary.
- PprOptions
- Personalized PageRank options.
- ReplicationPeerStatus
- One immutable row in a replication snapshot.
- ReplicationStatus
- Explicit point-in-time replication status snapshot.
- RetryPolicy
- Opt-in bounded retry policy for mobile network failures.
- ScanCursor
- Opaque cursor returned by one scan page and accepted by its next request.
- SearchCapabilities
- Discoverable full-text-search contract for one serving endpoint.
- SearchDisabled
- The serving endpoint has its search index disabled.
- SearchEnabled
- Search ran and returned an immutable ranked hit list.
- SearchHit
- One immutable BM25-ranked hit; equal scores use raw key ascending.
- SearchIndexStats
- Observable logical and retained search-index capacity snapshot.
- SearchOptions
- Optional full-text relevance controls.
- SearchPage
- One bounded page from an endpoint-sticky ranked snapshot.
- SearchResult
- Result of one search, including the server-configured disabled state.
- SearchUpdate
- Latest-query-wins delivery from IncrementalSearch.
- ServerStatus
- Explicit point-in-time server status snapshot.
- StringValue
- A string vertex value.
- TimestampValue
- A UTC timestamp vertex value.
- TraversalOptions
- Exactly one typed Illuminate family.
- Uint32Value
- An unsigned 32-bit vertex value.
- Uint64Value
- An unsigned 64-bit vertex value.
- UnsetValue
- The absent oneof arm.
- Vertex
- Immutable SDK-facing vertex.
- VertexInput
- Input for a vertex write.
- VertexPutResult
- Result of one vertex Put, including its request identity.
- VertexValue
- Exact Protobuf oneof value carried by a Vertex.
Enums
- DegreeDirection
- Direction used by cold-start degree ranking.
- LanternCode
- Stable SDK error categories suitable for mobile UI handling.
- PutOutcome
- Server-authoritative result of one idempotent Put.
- ReplicationPeerState
- Replication peer lifecycle state.
- ScanOrder
- Lexicographic order for vertex and vertex-key cursor scans.
- SearchErrorReason
- Machine-readable reason for a typed search failure.
- SearchHitProjectionStatus
- Per-hit projection state.
- SearchIndexHealth
- Whether the local derived search index can safely serve results.
- SearchMatchMode
- How a multi-term query selects matching vertices.
- SearchProjection
- Ranked-hit payload size.
- SearchUpdatePhase
- Incremental search delivery phase.
- TraversalObjective
- Direction for traversal weight-sensitive optimization.
- TraversalReduction
- Optional post-traversal tree view.
- TraversalWeighting
- Shared edge-weight transform applied before traversal.
Extensions
- LanternCrud on LanternClient
- Core vertex and edge operations for LanternClient.
- LanternDecay on LanternClient
- Decaying-edge conveniences for LanternClient.
- LanternScan on LanternClient
- Cursor-paged scans and explicitly scoped prefix operations.
- LanternSearch on LanternClient
- Full-text and incremental search operations.
- LanternStatus on LanternClient
- Cold-start ranking and explicit status snapshots.
- LanternTraversal on LanternClient
- Typed traversal operations.
Constants
- maxDecaySteps → const int
- Maximum contribution fan-out for one decaying edge helper call.
Functions
-
contributionIdFrom(
{required Uint8List nonce, required BigInt sequence, required int index}) → Uint8List - Builds Lantern's canonical 24-byte contribution ID.
-
decayContributions(
{required String tail, required String head, required DecayOptions options, required DateTime base}) → List< EdgeInput> - Expands a target geometric curve into staggered-TTL additive writes.
-
halfLifeDecay(
{required double initialWeight, required Duration halfLife, required Duration interval, required Duration horizon}) → DecayOptions - Creates DecayOptions from a half-life and sampling horizon.
Typedefs
- LanternClock = DateTime Function()
- Supplies wall-clock time for relative expiration calculation.
-
LanternCloseCallback
= FutureOr<
void> Function() - Releases resources owned by an injected transport.
- LanternHttpClientFactory = HttpClient Function()
- Creates a native Dart HTTP client owned by LanternClient.
- LanternInterceptor = Interceptor
- A Connect interceptor accepted by the default or factory transport.
- LanternTransport = Transport
- The low-level Connect transport accepted for advanced injection.
-
LanternTransportFactory
= LanternTransport Function(Uri endpoint, List<
LanternInterceptor> interceptors) - Creates a Connect transport for a normalized endpoint.
-
TokenProvider
= FutureOr<
String?> Function() - Supplies the bearer token for one transport attempt.
Exceptions / Errors
- BatchException
- A plural write failed after one or more prior chunk responses were observed.
- LanternAbortedException
- An operation that was aborted because its continuation state changed.
- LanternCanceledException
- A caller-canceled operation.
- LanternDeadlineExceededException
- An operation whose deadline expired.
- LanternException
- Base class for typed Lantern client failures.
- LanternFailedPreconditionException
- An operation that failed a state precondition.
- LanternHealthStatusException
- The health endpoint replied successfully but reported a non-serving state.
- LanternInternalException
- An internal, unknown, or unmapped transport failure.
- LanternInvalidArgumentException
- An invalid request.
- LanternNotFoundException
- A missing entity.
- LanternPermissionDeniedException
- A permission-denied operation.
- LanternResourceExhaustedException
- A resource-exhausted operation.
- LanternRetryExhaustedException
- A retry-eligible operation exhausted its bounded attempt budget.
- LanternSearchContinuationLimitedException
- The server retained only a bounded prefix of one search snapshot.
- LanternSearchCursorStaleException
- The endpoint-sticky search session expired or was evicted.
- LanternUnauthenticatedException
- An unauthenticated operation.
- An unavailable endpoint.