All Projects → peburrows → kane

peburrows / kane

Licence: MIT license
Google Pub/Sub client for Elixir

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to kane

iris3
An upgraded and improved version of the Iris automatic GCP-labeling project
Stars: ✭ 38 (-58.7%)
Mutual labels:  gcp, pubsub, google-cloud-platform, google-cloud-pubsub
terraform-splunk-log-export
Deploy Google Cloud log export to Splunk using Terraform
Stars: ✭ 26 (-71.74%)
Mutual labels:  gcp, pubsub, google-cloud-platform
gSlack
Get Slack notifications from Google Cloud Platform
Stars: ✭ 69 (-25%)
Mutual labels:  gcp, google-cloud-platform, google-cloud-pubsub
augle
Auth + Google = Augle
Stars: ✭ 22 (-76.09%)
Mutual labels:  gcp, google-cloud-platform
zorya
Google Cloud Instance Scheduler helping to reduce costs by 60% on average for non-production environments.
Stars: ✭ 127 (+38.04%)
Mutual labels:  gcp, google-cloud-platform
cloud-speech-and-vision-demos
A set of demo applications that make use of google speech, nlp and vision apis based in angular2
Stars: ✭ 35 (-61.96%)
Mutual labels:  gcp, google-cloud-platform
auth
A GitHub Action for authenticating to Google Cloud.
Stars: ✭ 567 (+516.3%)
Mutual labels:  gcp, google-cloud-platform
k8s-digester
Add digests to container and init container images in Kubernetes pod and pod template specs. Use either as a mutating admission webhook, or as a client-side KRM function with kpt or kustomize.
Stars: ✭ 65 (-29.35%)
Mutual labels:  gcp, google-cloud-platform
pubsub cli
super handy google cloud Pub/Sub CLI
Stars: ✭ 32 (-65.22%)
Mutual labels:  gcp, pubsub
emulator-tools
Google Cloud BigTable and PubSub emulator tools to make development a breeze
Stars: ✭ 16 (-82.61%)
Mutual labels:  pubsub, google-cloud-platform
GoogleCloudLogging
Swift (Darwin) library for logging application events in Google Cloud.
Stars: ✭ 24 (-73.91%)
Mutual labels:  gcp, google-cloud-platform
cloudenvoy
Cross-application messaging for Ruby and Rails using Google Cloud Pub/Sub
Stars: ✭ 31 (-66.3%)
Mutual labels:  pubsub, google-cloud-platform
gcp auth
Minimal authentication library for Google Cloud Platform (GCP)
Stars: ✭ 42 (-54.35%)
Mutual labels:  gcp, google-cloud-platform
gisjogja
GISJOGJA - aplikasi web based sistem informasi geografis (SIG) / GIS wisata kota JOGJA - www.firstplato.com
Stars: ✭ 17 (-81.52%)
Mutual labels:  gcp, google-cloud-platform
deploy-appengine
A GitHub Action that deploys source code to Google App Engine.
Stars: ✭ 184 (+100%)
Mutual labels:  gcp, google-cloud-platform
awesome-bigquery-views
Useful SQL queries for Blockchain ETL datasets in BigQuery.
Stars: ✭ 325 (+253.26%)
Mutual labels:  gcp, google-cloud-platform
course-material
Course Material for in28minutes courses on Java, Spring Boot, DevOps, AWS, Google Cloud, and Azure.
Stars: ✭ 544 (+491.3%)
Mutual labels:  gcp, google-cloud-platform
drf-angular-docker-tutorial
Dockerized Django Back-end API using DRF with Angular Front-end Tutorial
Stars: ✭ 53 (-42.39%)
Mutual labels:  gcp, google-cloud-platform
Goth
Elixir package for Oauth authentication via Google Cloud APIs
Stars: ✭ 191 (+107.61%)
Mutual labels:  gcp, google-cloud-platform
GCP
All files containing commands which can be used to complete GCP quests and challenge labs
Stars: ✭ 46 (-50%)
Mutual labels:  gcp, google-cloud-platform

Build Status

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

  1. Add Kane to your list of dependencies in mix.exs:
def deps do
  [{:kane, "~> 0.9.0"}]
end
  1. 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!
  1. 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:

For more details, see the documentation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].