at_persistence_secondary_server 1.0.1+5 copy "at_persistence_secondary_server: ^1.0.1+5" to clipboard
at_persistence_secondary_server: ^1.0.1+5 copied to clipboard

unlistedoutdated

at_persistence_secondary_server is the Persistence layer implementation for @protocol secondary server.

example/main.dart

import 'package:at_persistence_secondary_server/at_persistence_secondary_server.dart';
import 'package:at_persistence_secondary_server/src/keystore/secondary_persistence_store_factory.dart';

Future<void> main(List<String> arguments) async {
  // keystore
  var keyStoreManager = SecondaryPersistenceStoreFactory.getInstance()
      .getSecondaryPersistenceStore('@alice');
  var keyStore = keyStoreManager.getSecondaryKeyStore();
  var atData = AtData();
  atData.data = '123';
  var result = await keyStore.create('phone', atData);
  print(result);

  //commitLog keystore
  var commitLogInstance =
      await AtCommitLogManagerImpl.getInstance().getCommitLog('@alice');
  var hiveKey =
      await commitLogInstance.commit('location@alice', CommitOp.UPDATE);
  var committedEntry = await commitLogInstance.getEntry(hiveKey);
  print(committedEntry);

  //Notification keystore
  var notificationKeyStore = AtNotificationKeystore.getInstance();
  var atNotification = (AtNotificationBuilder()
        ..id = '123'
        ..fromAtSign = '@alice'
        ..notificationDateTime = DateTime.now().toUtc()
        ..toAtSign = '@alice'
        ..notification = 'self_received_notification'
        ..type = NotificationType.received
        ..opType = OperationType.update)
      .build();
  await notificationKeyStore.put('@alice', atNotification);
  var notificationEntry = await notificationKeyStore.get('@alice');
  print(notificationEntry);
}
5
likes
0
pub points
76%
popularity

Publisher

verified publisheratsign.org

at_persistence_secondary_server is the Persistence layer implementation for @protocol secondary server.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

at_commons, at_persistence_spec, at_utils, cron, crypto, hive, path, utf7, uuid

More

Packages that depend on at_persistence_secondary_server