https://github.com/oolong-dev/cloudevents.jl
Julia SDK for https://github.com/cloudevents/spec
https://github.com/oolong-dev/cloudevents.jl
Last synced: about 2 months ago
JSON representation
Julia SDK for https://github.com/cloudevents/spec
- Host: GitHub
- URL: https://github.com/oolong-dev/cloudevents.jl
- Owner: oolong-dev
- License: mit
- Created: 2022-01-11T06:22:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-22T10:43:42.000Z (over 1 year ago)
- Last Synced: 2025-01-20T16:59:15.040Z (4 months ago)
- Language: Julia
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CloudEvents
This package provides the Julia SDK for [CloudEvents](https://github.com/cloudevents/spec).
## Basic Usage
Below we provide the most common usages.
```julia
using CloudEvents# Create a CloudEvent manually
data = Dict("message" => "Hello World!")
ce = CloudEvent(data; type="example", source="https://example.com/event-producer")headers, body = to_http(ce) # structure mode by default
# headers, body = to_http(ce, :binary) # or binary mode# Send CloudEvent
using HTTPHTTP.post("", headers, body)
# Receive CloudEvent
using JSON3
HTTP.serve() do req
ce = from_http(HTTP.headers(req), JSON3.read(req.body))
end
```