Requires
- module:net
- module:md5
- module:github
- module:gitlab
- module:bitbucket
Methods
(inner) handleRequest(data, st, socket) → {boolean}
Handle an incoming request. A single message may span multiple requests,
and the first request for a message will include size/checksum headers
in addition to the message being sent. The existing message state is
maintained by the calling scope and must be passed as a paramter.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
object | the Buffer containing incoming data |
st |
object | processing state of current request |
socket |
object | the server socket for sending responses |
Returns:
true if message was completed, false to keep going
- Type
- boolean
(inner) resetState(state)
Reset the current request state to its starting values. This state object
will read the headers in the first request object, then append subsequent
requests to a message buffer until the entire request has been received.
At that time the message will be passed off to handleRequest and the
request state should be reset.
Parameters:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
state |
object | processing state of current request
Properties
|
(inner) runQuery(query, onFulfilled, onRjected) → {boolean}
Execute the specified query with onFulfilled and onRejected callbacks.
Parameters:
| Name | Type | Description |
|---|---|---|
query |
string | the query to run |
onFulfilled |
function | called with result if query is successful |
onRjected |
function | called with error if query fails |
Returns:
true for valid query string, false
otherwise
- Type
- boolean
(inner) sendResponse(socket, transactionId, data)
Serialize data to JSON and send to client over socket.
Parameters:
| Name | Type | Description |
|---|---|---|
socket |
object | the socket to send the response over |
transactionId |
string | the transactionId for this response |
data |
object | the data to serialize and send |
(inner) startServer() → {object}
Start up the Rodney for Gabbo server.
Returns:
the newly started server instance
- Type
- object