1.0.4 • Published 6 years ago

moar-rpc-client v1.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

Classes

Typedefs

Client

Client for JSON/REST/RPC over http with AWS4 signatures

Kind: global class

new Client(host, keys)

Create client for a host

ParamTypeDescription
hoststringHost name
keysCredentialsOptional credentials for AWS4 signing

Example

const client = new Client('api.moarhealth.com')
client.call({
    greeting: "Mark"
    initialize: { "some": "stuff" }
}).then(results => {
     console.log(`Result for greeting was ${results.greeting}`)
     console.log(`Result for initialize was ${results.initialize}`)
})

client.call(structures) ⇒ CallResult

Call one or more methods

Kind: instance method of Client
Returns: CallResult - A promise to produce

ParamTypeDescription
structuresCallStructureStructure for the calls the client will make.

CallResult : CallResultArray

Map of s for the associated calls

Kind: global typedef

CallResultArray

Kind: global typedef
Properties

NameTypeDescription
0objectError object
1objectData object

CallStructure : CallResultArray

A structure with method names and their associated parameters.

Each result is an for the associated call key.

Kind: global typedef