Skizze client for Node.js
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
.gitignore
.jshintrc
.npmignore
LICENSE
README.md
index.js
package.json
skizze.proto

README.md

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

SkizzeClient

Members

sketchType : enum

Enum for Sketch type values.

snapshotState : enum

Enum for Snapshot state values.

Functions

createClient(address, options)SkizzeClient

Creates and returns a new client connection to Skizze

SkizzeClient

Kind: global class

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
  • Example
  • Versioning
  • npm

License

node-skizze is available under the Apache License, Version 2.0.

Authors