Popularity
7.0
Stable
Activity
0.0
Stable
96
2
41
Monthly Downloads: 3,821
Programming language: Elixir
License: MIT License
Tags:
Third Party APIs
Latest version: v0.8.1
kane alternatives and similar packages
Based on the "Third Party APIs" category.
Alternatively, view kane alternatives based on common mentions on social networks and blogs.
-
MongoosePush
MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS. -
sparkpost
SparkPost client library for Elixir https://developers.sparkpost.com -
elixtagram
:camera: Instagram API client for the Elixir language (elixir-lang) -
google_sheets
Elixir library for fetching Google Spreadsheet data in CSV format -
pay_pal
:money_with_wings: PayPal REST API client for the Elixir language (elixir-lang) -
amazon_product_advertising_client
An Amazon Product Advertising API client for Elixir -
cashier
Cashier is an Elixir library that aims to be an easy to use payment gateway, whilst offering the fault tolerance and scalability benefits of being built on top of Erlang/OTP -
elixir_ipfs_api
The Elixir library that is used to communicate with the IPFS REST endpoint.
Access the most powerful time series database as a service
Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
Promo
www.influxdata.com
Do you think we are missing an alternative of kane or a related project?
Popular Comparisons
README
Kane
Kane. Citizen Kane. Charles Foster Kane, to be exact, Publisher extraordinaire. Rosebud.
Kane is for publishing and subscribing to topics using Google Cloud Pub/Sub.
Installation
- Add Kane to your list of dependencies in
mix.exs
:
def deps do
[{:kane, "~> 0.7.0"}]
end
- Configure Goth (Kane's underlying token storage and retrieval library) with your Google JSON credentials:
config :goth,
json: "path/to/google/json/creds.json" |> File.read!
- Ensure Kane is started before your application:
def application do
[applications: [:kane]]
end
Usage
Pull, process and acknowledge messages via a pre-existing subscription:
subscription = %Kane.Subscription{
name: "my-sub",
topic: %Kane.Topic{
name: "my-topic"
}
}
{:ok, messages} = Kane.Subscription.pull(subscription)
Enum.each messages, fn(mess)->
process_message(mess)
end
# acknowledge message receipt in bulk
Kane.Subscription.ack(subscription, messages)
Send message via pre-existing subscription:
topic = %Kane.Topic{name: "my-topic"}
message = %Kane.Message{data: %{"hello": "world"}, attributes: %{"random" => "attr"}}
result = Kane.Message.publish(message, topic)
case result do
{:ok, _return} -> IO.puts("It worked!")
{:error, _reason} -> IO.puts("Should we try again?")
end
Hints:
- Attributes have to be Strings (https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage)
- We base64-encode the message by default (only mandatory when using json - https://cloud.google.com/pubsub/publisher)
For more details, see the documentation.