File tree Expand file tree Collapse file tree 1 file changed +29
-4
lines changed Expand file tree Collapse file tree 1 file changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,10 @@ Javascript SDK for CloudEvents
8
8
``` text
9
9
├── index.js
10
10
├── lib
11
+ │ ├── bindings
12
+ │ │ └── http
13
+ │ │ └── structured_0_1.js
11
14
│ ├── cloudevent.js
12
- │ ├── jsonformatter.js
13
15
│ ├── format
14
16
│ │ └── json_0_1.js
15
17
│ └── specs
@@ -20,12 +22,18 @@ Javascript SDK for CloudEvents
20
22
├── README.md
21
23
└── test
22
24
├── cloudevent_spec_0_1.js
23
- └ ── cloudevent_spec_0_2.js
24
-
25
+ ├ ── cloudevent_spec_0_2.js
26
+ └── http_binding_0_1.js
25
27
```
26
28
27
29
* ` index.js ` : library exports
28
30
31
+ * ` lib/bindings ` : every binding implementation goes here
32
+
33
+ * ` lib/bindings/http ` : every http binding implementation goes here
34
+
35
+ * ` lib/bindings/http/structured_0_1.js ` : implementation of structured HTTP Binding
36
+
29
37
* ` lib/cloudevent.js ` : implementation of Cloudevent, an interface
30
38
31
39
* ` lib/format/ ` : every format implementation goes here
@@ -100,10 +108,27 @@ Every Spec class must implement these methods to work properly.
100
108
Spec (Cloudevent)
101
109
102
110
/*
103
- * Check the spec constraints, throwing an error if do not pass.
111
+ * Checks the spec constraints, throwing an error if do not pass.
104
112
*/
105
113
Spec .check ()
106
114
115
+ ```
116
+ ## ` Binding ` classes
117
+
118
+ Every Binding class must implement these methods to work properly.
119
+
120
+ ``` js
121
+
122
+ /*
123
+ * The constructor must receives the map of configurations.
124
+ */
125
+ Binding (config)
126
+
127
+ /*
128
+ * Emits the event using an instance of Cloudevent.
129
+ */
130
+ Binding .emit (cloudevent)
131
+
107
132
```
108
133
109
134
# How to use
You can’t perform that action at this time.
0 commit comments