Document the unmarshaller export
Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
parent
bebb3b0e97
commit
2044d0da84
27
README.md
27
README.md
|
@ -20,35 +20,40 @@ Before create an awesome PR, please read our [guidelines](./CONTRIBUTING.md).
|
||||||
|
|
||||||
To see working examples, point to [examples](./examples).
|
To see working examples, point to [examples](./examples).
|
||||||
|
|
||||||
## :newspaper: News Letter :newspaper:
|
## :newspaper: Newsletter :newspaper:
|
||||||
|
|
||||||
Checkout the expressive changes.
|
> all the API developed before, for 0.1 and 0.2, works as the same.
|
||||||
|
|
||||||
|
Checkout the new expressive additions.
|
||||||
|
|
||||||
### New way to import the specifications stuff
|
### New way to import the specifications stuff
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// Import the v0.2. stuff
|
// Import the v0.3 stuff
|
||||||
var v02 = require("cloudevents-sdk/v02");
|
const v03 = require("cloudevents-sdk/v03");
|
||||||
|
|
||||||
// Access the spec
|
// Access the spec
|
||||||
v02.Spec;
|
v03.Spec;
|
||||||
|
|
||||||
// Access the structured http event emitter
|
// Access the structured http event emitter
|
||||||
v02.StructuredHTTPEmitter;
|
v03.StructuredHTTPEmitter;
|
||||||
|
|
||||||
// Access the binary http event emitter
|
// Access the binary http event emitter
|
||||||
v02.BinaryHTTPEmitter;
|
v03.BinaryHTTPEmitter;
|
||||||
|
|
||||||
|
// Access http unmarshaller to process incoming events
|
||||||
|
v03.Unmarshaller;
|
||||||
```
|
```
|
||||||
|
|
||||||
### An easy way to create events
|
### An easy way to create events
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// Import the v0.2 stuff
|
// Import the v0.3 stuff
|
||||||
var v02 = require("cloudevents-sdk/v02");
|
const v03 = require("cloudevents-sdk/v03");
|
||||||
|
|
||||||
// Creates an event using the v0.2 spec
|
// Creates an event using the v0.3 spec
|
||||||
let ce =
|
let ce =
|
||||||
v02.event()
|
v03.event()
|
||||||
.type("com.github.pull.create")
|
.type("com.github.pull.create")
|
||||||
.source("urn:event:from:myapi/resourse/123");
|
.source("urn:event:from:myapi/resourse/123");
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue