Keenex

This module defines the Keenex API. Use it as follows

looks for application variables in the :keen app named :project_id, :write_key, :read_key or if any of those aren’t available, it looks for environment variables named KEEN_PROJECT_ID, KEEN_WRITE_KEY, KEEN_READ_KEY

{:ok, keen} = Keenex.new

alternatively, you can pass in the variables as well

{:ok, keen} = Keenex.new("keen_project_id", "keen_write_key", "keen_read_key")

then pass in the keen pid when calling functions

{status, response} = Keenex.EventCollections.post(keen, "dinner.tacos", %{test: "tacos"})

status is either :ok or :error

response is a Map converted from the json response from Keen.

Info about the contents can be found here

Source

Summary

config(keen)

Returns the entire config struct

new()

Starts new Keenex config process

new(project_id, write_key, read_key)

Starts new Keenex config process with the given project_id, write_key, and read_key

project_id(keen)

Returns the project id

read_key(keen)

Returns the read key

start_link(config)
write_key(keen)

Returns the write key

Types

status :: :ok | :error

response :: {status, %{}}

Functions

config(keen)

Specs:

Returns the entire config struct

Source
new()

Specs:

Starts new Keenex config process.

Looks for application variables in the :keen app named :project_id, :write_key, :read_key or if any of those aren’t available, it looks for environment variables named KEEN_PROJECT_ID, KEEN_WRITE_KEY, KEEN_READ_KEY

Source
new(project_id, write_key, read_key)

Specs:

Starts new Keenex config process with the given project_id, write_key, and read_key

Source
project_id(keen)

Specs:

  • project_id(pid) :: binary

Returns the project id

Source
read_key(keen)

Specs:

  • read_key(pid) :: binary

Returns the read key

Source
start_link(config)

Specs:

Source
write_key(keen)

Specs:

  • write_key(pid) :: binary

Returns the write key

Source