From 30f499cbc1f9b33dbccb2cc419d7e65d4a4ae461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabio=20Jos=C3=A9?= Date: Tue, 11 Jun 2019 21:29:09 -0300 Subject: [PATCH] Document the receiver and receiver server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabio José --- README.md | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4418c14..133a938 100644 --- a/README.md +++ b/README.md @@ -315,17 +315,6 @@ Binding(config) * Emits the event using an instance of Cloudevent. */ Binding.emit(cloudevent) - -/* - * Checks if some Object and a Map of headers - * follows the binding definition. Throw an error if did not follow - */ -Binding.check(Object, Map) - -/* - * Checks and parse the Binary as Cloudevent - */ -Cloudevent Binding.parse(Object, Map) ``` #### Receiver Binding @@ -336,12 +325,32 @@ Following we have the signature for the binding to receive Cloudevents. /* * The constructor must receives the map of configurations. */ -ReceiverBinding(config) +Receiver(config) + +/* + * Checks if some Object and a Map of headers + * follows the binding definition, throwing an error if did not follow + */ +Receiver.check(Object, Map) + +/* + * Checks and parse as Cloudevent + */ +Cloudevent Receiver.parse(Object, Map) +``` + +##### Receiver Binding Server + +```js +/* + * The constructor must receives the map of configurations. + */ +Receiver(config) /* * Receives the events and returns a Promise. */ -ReceiverBinding.receive() +Receiver.receive() ``` > See how to implement the method injection [here](lib/specs/spec_0_1.js#L17)