alldata-client-http
Stability: 1 - Experimental
Client HTTP module for AllData, a distributed master-less write-once immutable event store database implementing "All Data" part of Lambda Architecture.
Usage
var AllDataClient = ;var allDataClient = hostname: "localhost" method: "POST" path: "/put" port: 80 ; var event1 = customer: 1 action: "site visit"; allDataClient; var event2 = customer: 1 action: "login"; allDataClient;
Test
npm test
Overview
AllDataClient is an HTTP client for AllData. Once configured, it sends HTTP requests for every event.
Documentation
AllDataClient
Public API
new AllDataClient(options)
options
: Objecthostname
: String (Default:localhost
) HTTP hostname of the AllData server.method
: String (Default:POST
) HTTP method.path
: String (Default:/
) HTTP request path.port
: Number (Default: 80) HTTP port of remote server.
Creates a new instance of AllDataClient.
allDataClient.put(event, [callback])
event
: Object JavaScript object representing the event to store.callback
: Function (Default: undefined)function (error) {}
An optional callback to call in case of success or failure.
Attempts to store the event
in AllData service via HTTP. If a callback
is provided it will be called with an Error
instance if an error occurs or with no parameters otherwise.
allDataClient;