GithubHelp home page GithubHelp logo

kevinbader / cloudevents-ex Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 3.0 78 KB

Elixir SDK for CloudEvents

Home Page: https://hex.pm/packages/cloudevents

License: Apache License 2.0

Elixir 99.80% Shell 0.20%
cloudevents elixir

cloudevents-ex's Introduction

Hex pm Hex Docs Apache 2.0 license

Cloudevents is an Elixir SDK for consuming and producing CloudEvents with support for various transport protocols and codecs. If you want to learn more about the specification itself, make sure to check out the official spec on GitHub.

Cloudevents is released under the Apache License 2.0 - see the LICENSE file.

Supported versions

  • OTP 25.0 and later
  • Elixir 1.13 and later

Status

Spec Status
Core Specification:
CloudEvents v0.1, v0.2, v1.0
Optional Specifications:
AMQP Protocol Binding out of scope for now (PR welcome)
AVRO Event Format todo (PR welcome)
HTTP Protocol Binding wip (done except batch mode)
JSON Event Format done
Kafka Protocol Binding v1.0
MQTT Protocol Binding out of scope for now (PR welcome)
NATS Protocol Binding out of scope for now (PR welcome)
Web hook out of scope for now (PR welcome)

Getting started

Add cloudevents to your list of dependencies in mix.exs:

def deps do
  [{:cloudevents, "~> 0.6.1"}]
end

Use Cloudevents.from_map/1 to create your first Cloudevent and see its JSON representation using Cloudevents.to_json/1.

If you're dealing with HTTP requests, Cloudevents.from_http_message/2, Cloudevents.to_http_binary_message/1 and Cloudevents.to_http_structured_message/2 are your friends.

If you need Avro, you need to add avrora to your dependency list:

def deps do
  [{:avrora, "~> 0.21"}]
end

Then, you need to add Cloudevents to your supervisor:

children = [
  Cloudevents
]

Supervisor.start_link(children, strategy: :one_for_one)

Or start Cloudevents manually:

{:ok, pid} = Cloudevents.start_link([])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.