Releases: cloudevents/conformance
Releases · cloudevents/conformance
Improved diff
Adding Diff command
diff
compares two yaml event files.
cloudevents diff ./want.yaml ./got.yaml
want.yaml
could have fewer fields specified to allow for fuzzy matching.
Example, if you only wanted to compare on type
and ignore additional fields:
$ cat ./want.yaml
ContextAttributes:
type: com.example.someevent
$ cat ./got.yaml
Mode: structured
ContextAttributes:
specversion: 1.0
type: com.example.someevent
time: 2018-04-05T03:56:24Z
id: 4321-4321-4321-a
source: /mycontext/subcontext
Extensions:
comexampleextension1 : "value"
comexampleextension2 : |
{"othervalue": 5}
TransportExtensions:
user-agent: "foo"
Data: |
{"world":"hello"}
$ cloudevents diff ./want.yaml ./got.yaml --match type --ignore-additions
This validates that at least one event of type com.example.someevent
is present in the got.yaml
file.
Adding history to listen command to cli.
New feature: return back the events that listen has collected via a GET on /history
.
Start the listener:
$ cloudevents listen
listening on :8080
Send a cloudevent:
$ cloudevents send http://localhost:8080/ --id abc-123 --source cloudevents.conformance.tool --type foo.bar
See it is collected by the listener:
$ go run ./cmd/cloudevents listen
listening on :8080
Mode: binary
ContextAttributes:
specversion: "1.0"
type: foo.bar
id: abc-123
source: cloudevents.conformance.tool
TransportExtensions:
User-Agent: Go-http-client/1.1
Data: ""
---
Collect history:
$ curl http://localhost:8080/history
Mode: binary
ContextAttributes:
specversion: "1.0"
type: foo.bar
id: abc-123
source: cloudevents.conformance.tool
TransportExtensions:
User-Agent: Go-http-client/1.1
Data: ""
Adding Structured mode support.
Use via the new top-level yaml header: Mode: structured
Mode: structured
ContextAttributes:
specversion: 1.0
type: com.example.someevent
id: 4321-4321-4321
source: /mycontext/subcontext
Or
cloudevents send http://localhost:8080/ --id 321-cba --source cloudevents.conformance.tool --type foo.json --mode structured --data='{"hello":"world"}'
The data parsing in structured mode is very basic.
Release v0.1.0
First release of conformance cli and supporting code.