GatewayWsDatabase class abstract

Abstraction to access a JSON-like WebSocket database (canvas domain).

  • Uses Either con ErrorItem, ... for success/failure.
  • Embeds the docId into the returned JSON under idKey (default: 'id').
  • Maps thrown exceptions using ErrorMapper.
Implementers

Constructors

GatewayWsDatabase()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(String docId) Future<Either<ErrorItem, Unit>>
Deletes a document. Returns Unit on success.
detachWatch(String docId) → void
Cleans up active watch on docId, if any.
dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String docId) Future<Either<ErrorItem, Map<String, dynamic>>>
Reads a document by docId. Returns the raw JSON with idKey injected.
releaseDoc(String docId) → void
Cleans up resources related to docId (e.g. active listeners).
toString() String
A string representation of this object.
inherited
watch(String docId) Stream<Either<ErrorItem, Map<String, dynamic>>>
Watches a single document. Emits Either on each tick.
write(String docId, Map<String, dynamic> json) Future<Either<ErrorItem, Map<String, dynamic>>>
Writes (create/update) a document. Returns the JSON considered authoritative:

Operators

operator ==(Object other) bool
The equality operator.
inherited