skizze
v0.0.3
Published
Node.js bindings to Skizze (https://github.com/skizzehq/skizze)
Downloads
1
Maintainers
Readme
node-skizze
node-skizze are Node.js bindings for the Skizze database.
NOTE node-skizze
is alpha software and still in heavy development.
Installation
$ npm install --save skizze
Example
var skizze = require('skizze');
var client = skizze.createClient("127.0.0.1:3596", { insecure: true });
client.createDomain("mydomain", function(err) {
client.addToDomain("mydomain", ['alvin', 'simon', 'theodore'], function(err) {
client.getCardinality("mydomain", function(err, card) {
console.log(err, card);
});
});
});
Documentation
Classes
Members
Functions
SkizzeClient
Kind: global class
- SkizzeClient
- new SkizzeClient()
- .createSnapshot(callback)
- .getSnapshot(callback)
- .listSketches(type, callback)
- .listDomains(callback)
- .listAll(callback)
- .createDomain(name, callback)
- .createDomainWithProperties(name, sketches, callback)
- .deleteDomain(name, callback)
- .getDomain(name, callback)
- .createSketch(name, callback)
- .deleteSketch(name, callback)
- .getSketch(name, callback)
- .addToDomain(name, values, callback)
- .addToSketch(name, values, callback)
- .getMembership(name, values, callback)
- .getMultiMembership(names, values, callback)
- .getFrequency(name, values, callback)
- .getMultiFrequency(names, values, callback)
- .getRankings(name, callback)
- .getMultiRankings(names, callback)
- .getCardinality(name, callback)
- .getMultiCardinality(names, callback)
new SkizzeClient()
Represents a connection to the Skizze database.
skizzeClient.createSnapshot(callback)
Request a snapshot to be taken.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | callback | function | A callback to call when a reply is received. |
skizzeClient.getSnapshot(callback)
Get details of the current or last snapshot.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | callback | function | A callback to call with the details of the snapshot. |
skizzeClient.listSketches(type, callback)
List Sketches of a specific type.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | type | number | The type of sketch to list. | | callback | function | A callback to call with the list of Sketches. |
skizzeClient.listDomains(callback)
List all domains.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | callback | function | A callback to call with the list of Domains. |
skizzeClient.listAll(callback)
List all Sketches.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | callback | function | A callback to call with the list of Sketches. |
skizzeClient.createDomain(name, callback)
Create a new domain with default settings for it's Sketches.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the new domain. | | callback | function | A callback to call with the newly created domain. |
skizzeClient.createDomainWithProperties(name, sketches, callback)
Create a new domain with customized settings.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the new domain. | | sketches | Object | Configuration for each sketch type. | | callback | function | A callback to call with the newly created domain. |
skizzeClient.deleteDomain(name, callback)
Delete a domain.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the domain to delete. | | callback | function | A callback to call when the operation is complete. |
skizzeClient.getDomain(name, callback)
Get details of an existing domain.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the domain to get. | | callback | function | A callback to call with the domain details. |
skizzeClient.createSketch(name, callback)
Create a new Sketch.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the Sketch to create. | | callback | function | A callback to call with the new Sketch. |
skizzeClient.deleteSketch(name, callback)
Delete a Sketch.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the sketch to delete. | | callback | function | A callback to call when the operation is complete. |
skizzeClient.getSketch(name, callback)
Get details of an existing sketch.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the sketch to get. | | callback | function | A callback to call with the sketch details. |
skizzeClient.addToDomain(name, values, callback)
Add values to a domain.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the domain. | | values | Array(string) | The values to add to the domain. | | callback | function | A callback to call when the operation is complete. |
skizzeClient.addToSketch(name, values, callback)
Add values to a sketch.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the sketch. | | values | Array(string) | The values to add to the sketch. | | callback | function | A callback to call when the operation is complete. |
skizzeClient.getMembership(name, values, callback)
Query the sketch for membership (true/false) for the provided values.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the sketch. | | values | Array(string) | The values to query the membership of. | | callback | function | A callback to call with the results. |
skizzeClient.getMultiMembership(names, values, callback)
Query the sketches for membership (true/false) for the provided values.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | names | Array(string) | The names of the sketches to check. | | values | Array(string) | The values to query the membership of. | | callback | function | A callback to call with the results. |
skizzeClient.getFrequency(name, values, callback)
Query the sketch for frequency of the provided values.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the sketch. | | values | Array(string) | The values to query the frequency of. | | callback | function | A callback to call with the results. |
skizzeClient.getMultiFrequency(names, values, callback)
Query the sketches for frequency of the provided values.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | names | Array(string) | The names of the sketches to check. | | values | Array(string) | The values to query the frequency of. | | callback | function | A callback to call with the results. |
skizzeClient.getRankings(name, callback)
Query the sketch for top rankings.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the sketch. | | callback | function | A callback to call with the results. |
skizzeClient.getMultiRankings(names, callback)
Query the sketches top rankings.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | names | Array(string) | The names of the sketches to check. | | callback | function | A callback to call with the results. |
skizzeClient.getCardinality(name, callback)
Query the sketch for cardinality.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | name | string | The name of the sketch. | | callback | function | A callback to call with the results. |
skizzeClient.getMultiCardinality(names, callback)
Query the sketches for cardinality.
Kind: instance method of SkizzeClient
| Param | Type | Description | | --- | --- | --- | | names | Array(string) | The names of the sketches to check. | | callback | function | A callback to call with the results. |
sketchType : enum
Enum for Sketch type values.
Kind: global enum
Read only: true
Properties
| Name | Type | Default | | --- | --- | --- | | MEMBERSHIP | number | MEMBERSHIP | | FREQUENCY | number | FREQUENCY | | RANKINGS | number | RANKINGS | | CARDINALITY | number | CARDINALITY |
snapshotState : enum
Enum for Snapshot state values.
Kind: global enum
Read only: true
Properties
| Name | Type | Default | | --- | --- | --- | | PENDING | number | PENDING | | IN_PROGRESS | number | IN_PROGRESS | | SUCCESSFUL | number | SUCCESSFUL | | FAILED | number | FAILED |
createClient(address, options) ⇒ SkizzeClient
Creates and returns a new client connection to Skizze
Kind: global function
Returns: SkizzeClient - - A SkizzeClient.
| Param | Type | Description | | --- | --- | --- | | address | string | The address of the Skizze server e.g. "127.0.0.1:3596" | | options | Object | Options for configuring the client connection. | | options.insecure | boolean | Whether to create an insecure connection with the server. |
TODO
- [ ] Merge in testing
- [ ] Hook up to Travis
- [x] Example
- [x] Versioning
- [x] npm
License
node-skizze is available under the Apache License, Version 2.0.