new Connector(host, port, secure, basePath)
Parameters:
Name | Type | Description |
---|---|---|
host |
string | |
port |
number | |
secure |
boolean | |
basePath |
string |
- Source:
Members
(static) connections :Object.<string, connector.Connector>
Array of all created connections
Type:
- Object.<string, connector.Connector>
- Source:
(static) connectors :Array.<connector.Connector>
Array of all available connector implementations
Type:
- Array.<connector.Connector>
- Source:
(static) gzip
The connector will detect if gzip is supports.
Returns true if supported otherwise false.
- Source:
(static) RESPONSE_HEADERS :Array.<string>
An array of all exposed response headers
Type:
- Array.<string>
- Source:
(readonly) basePath :string
Type:
- string
- Source:
(abstract) doSend
Handle the actual message send
- Source:
(readonly) host :string
Type:
- string
- Source:
(readonly) origin :string
the origin do not contains the basepath
Type:
- string
- Source:
(readonly) port :number
Type:
- number
- Source:
(readonly) secure :boolean
Type:
- boolean
- Source:
Methods
(static) create(host, portopt, secureopt, basePathopt) → {connector.Connector}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
host |
string | or location |
|
port |
number |
<optional> |
|
secure |
boolean |
<optional> |
|
basePath |
string |
<optional> |
The basepath of the api |
- Source:
Returns:
- Type
- connector.Connector
(abstract, protected) fromFormat(response, entity, type) → {*}
Convert received data to the requested response entity type
Parameters:
Name | Type | Description |
---|---|---|
response |
Object | The response object |
entity |
* | The received data |
type |
string | The requested response format |
- Source:
Returns:
- Type
- *
prepareRequest(message) → {void}
Parameters:
Name | Type | Description |
---|---|---|
message |
connector.Message |
- Source:
Returns:
- Type
- void
prepareResponse(message, response) → {Promise.<*>}
Parameters:
Name | Type | Description |
---|---|---|
message |
connector.Message | |
response |
Object | The received response headers and data |
- Source:
Returns:
- Type
- Promise.<*>
send(message) → {Promise.<connector.Message>}
Parameters:
Name | Type | Description |
---|---|---|
message |
connector.Message |
- Source:
Returns:
- Type
- Promise.<connector.Message>
(abstract, protected) toFormat(message) → {void}
Convert the message entity to the sendable representation
Parameters:
Name | Type | Description |
---|---|---|
message |
connector.Message | The message to send |
- Source:
Returns:
- Type
- void