lantern_client 0.3.0 copy "lantern_client: ^0.3.0" to clipboard
lantern_client: ^0.3.0 copied to clipboard

Pure Dart client SDK for Lantern, an in-memory graph key-vertex store with TTL-aware vertices and edges.

example/lantern_client_example.dart

import 'dart:io';

import 'package:lantern_client/lantern_client.dart';

Future<void> main() async {
  final client = LanternClient.connect(
    Uri.parse('https://lantern.example.com'),
  );
  try {
    final outcome = await client.putVertex(
      VertexInput(
        key: 'user:42',
        value: VertexValue.string('alice'),
        expiresIn: const Duration(minutes: 30),
      ),
    );
    if (outcome != PutOutcome.appliedAndLive) {
      throw StateError('user:42 was not live after Put: $outcome');
    }
    final vertex = await client.getVertex('user:42');
    stdout.writeln((vertex.value as StringValue).value);
  } finally {
    await client.close();
  }
}
0
likes
0
points
1k
downloads

Publisher

unverified uploader

Weekly Downloads

Pure Dart client SDK for Lantern, an in-memory graph key-vertex store with TTL-aware vertices and edges.

Homepage
Repository (GitHub)
View/report issues

Topics

#connectrpc #graph #kvs #lantern

License

unknown (license)

Dependencies

connectrpc, fixnum, protobuf

More

Packages that depend on lantern_client