kronos-endpoint

2.15.0 • Public • Published

npm Greenkeeper semantic-release styled with prettier Build Status codecov.io Coverage Status Known Vulnerabilities GitHub Issues Stories in Ready Dependency Status devDependency Status docs XO code style downloads Commitizen friendly

kronos-endpoint

Named communication (end)-points inside of kronos

request forwarding

API

Table of Contents

Endpoint

Parameters

  • name string endpoint name
  • owner Object of the endpoint (service or step)
  • options Object (optional, default {})
    • options.opposite Endpoint? opposite endpoint
    • options.createOpposite boolean? true to auto create an opposite endpoint

isDefault

Indicate whatever we are a default endpoint. Default means buildin.

Returns boolean false

isIn

Returns boolean false

isOut

Returns boolean false

isOpen

Returns boolean false

isConnected

Returns boolean false

direction

Deliver data flow direction

Returns string delivers data flow direction 'in', 'out' or undefined

opposite

Deliver the opposite endpoint

Returns Endpoint representing the opposite direction

InterceptedEndpoint

Extends Endpoint

Endpoint with a list of interceptors also provides fistInterceptor and lastInterceptor

hasInterceptors

Returns boolean true if there is at least one interceptor assigned

interceptors

Deliver array of all assigned interceptors

Returns Array<Interceptor> the interceptors or empty array if none are present

interceptors

Set the interceptors a connected chain from array element 0 over all entries up to the last element in the array is formed. Additionally firstInterceptor and lastInterceptor are set.

Parameters

  • newInterceptors Array<Interceptor> replaces all interceptors

ReceiveEndpoint

Extends InterceptedEndpoint

Receiving Endpoint by default a dummy rejecting receiver is assigned

Parameters

connected

Connect other side to us

Parameters

  • other Endpoint endpoint to be connected to

sender

Deliver the sending side Endpoint

Returns SendEndpoint the sending side

receive

get the recive function

Returns Function

receive

Set the recive function If we know the sender we will inform him about our open/close state by calling willBeClosed() and hasBeenOpened()

Parameters

  • receive Function (optional, default rejectingReceiver)

isOpen

Are we able to receive requests

Returns boolean true if we are able to receive requests

isIn

We are always in

Returns boolean always true

ReceiveEndpointDefault

Extends ReceiveEndpoint

Receive Endpoint acting as a default endpoints

isDefault

We are a default endpoint

Returns boolean always true

SendEndpoint

Extends ConnectorMixin(InterceptedEndpoint)

Sending Endpoint

Parameters

  • name string endpoint name
  • owner Object of the endpoint (service or step)
  • options Object (optional, default {})
    • options.opposite Endpoint? endpoint going into the opposite direction
    • options.hasBeenConnected Function? called after connected
    • options.hasBeenDisconected Function? called after disconnected
    • options.hasBeenOpened Function? called after receiver is open
    • options.willBeClosed Function? called before receiver is closed

isOut

We are always out

Returns boolean always true

SendEndpointDefault

Extends SendEndpoint

Send Endpoint acting as a default endpoints

isDefault

We are a default endpoint

Returns boolean always true

install

With npm do:

npm install kronos-endpoint

license

BSD-2-Clause

Dependencies (1)

Dev Dependencies (9)

Package Sidebar

Install

npm i kronos-endpoint

Weekly Downloads

14

Version

2.15.0

License

BSD-2-Clause

Unpacked Size

34.6 kB

Total Files

6

Last publish

Collaborators

  • arlac77