at_lookup 3.0.13 at_lookup: ^3.0.13 copied to clipboard
A Dart library that contains the core commands that can be used with a secondary server (scan, update, lookup, llookup, plookup, etc.)
Now for a little internet optimism #
at_lookup_example library #
The atlookup package is an interface between the Client SDK and the cloud secondary.
Give it a try #
This package includes a sample code in the example directory for usage of the at_lookup library.
Usage #
Initializing the atLookup Instance
var atLookupImpl = AtLookupImpl(
'@alice',
'root.atsign.com',
64,
privateKey: 'privateKey',
cramSecret: 'cramSecret',
);
Update the key
//Build update verb builder
var updateVerbBuilder = UpdateVerbBuilder()
..atKey = 'phone'
..sharedBy = '@alice'
..sharedWith = '@bob'
..value = '+1 889 886 7879';
// Sends update command to secondary server
// Set sync attribute to true sync the value to secondary server.
var updateResult = atLookupImpl.executeVerb(updateVerbBuilder, sync: true);
Get the value of the key
// Builds lookup key builder
var lookupVerbBuilder = LookupVerbBuilder()
..atKey = 'phone'
..sharedBy = '@bob'
..auth = true;
// Sends lookup command to secondary server
var lookupResult = atLookupImpl.executeVerb(lookupVerbBuilder);
Retrieve the keys from the secondary server
// Builds scan verb builder
var scanVerbBuilder = ScanVerbBuilder();
var scanResult = atLookupImpl.executeVerb(scanVerbBuilder);
Delete the key from secondary server
//Builds delete verb builder
var deleteVerbBuilder = DeleteVerbBuilder()
..sharedWith = '@bob'
..atKey = 'phone'
..sharedBy = '@alice';
// Sends delete key to secondary server
var deleteResult = atLookupImpl.executeVerb(deleteVerbBuilder, sync: true);