The check api
Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
parent
eef6f60a9d
commit
545441e53e
17
README.md
17
README.md
|
|
@ -70,7 +70,9 @@ String Cloudevent.toString()
|
|||
|
||||
```
|
||||
|
||||
## `Formatter` class
|
||||
## `Formatter` classes
|
||||
|
||||
Every formatter class must implement these methods to work properly.
|
||||
|
||||
```js
|
||||
|
||||
|
|
@ -86,6 +88,19 @@ String Formatter.toString(payload)
|
|||
|
||||
```
|
||||
|
||||
## `Spec` classes
|
||||
|
||||
Every Spec class must implement these methods to work properly.
|
||||
|
||||
```js
|
||||
|
||||
/*
|
||||
* Check the spec constraints, throwing an error if do not pass.
|
||||
*/
|
||||
Spec.check()
|
||||
|
||||
```
|
||||
|
||||
# How to use
|
||||
|
||||
The `Cloudevent` constructor arguments.
|
||||
|
|
|
|||
|
|
@ -19,6 +19,15 @@ function Spec_0_1(_caller){
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Check the constraints.
|
||||
*
|
||||
* throw an error if do not pass.
|
||||
*/
|
||||
Spec_0_1.prototype.check = function() {
|
||||
|
||||
}
|
||||
|
||||
Spec_0_1.prototype.type = function(_type){
|
||||
this.payload['eventType'] = _type;
|
||||
return this;
|
||||
|
|
|
|||
Loading…
Reference in New Issue