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
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 |
Functions
Specs:
- new :: {Keenex.status, pid}
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
Specs:
- new(binary, binary, binary) :: {Keenex.status, pid}
Starts new Keenex config process with the given project_id, write_key, and read_key