View Source Kevo (kevo_ex v0.2.1)
Top-level interface and supervisor for Kevo's API and websocket connections.
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets the provided lock's event history. Follows the frontend's paging behavior.
Retrieves the given lock's state.
Retrieves all locks visible to the logged in user.
Locks the given lock.
Starts an instance of kevo_ex.
Unlocks the given lock.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec get_events(String.t(), integer(), integer(), atom()) :: {:ok, [map()]} | {:error, Kevo.ApiError.t()}
Gets the provided lock's event history. Follows the frontend's paging behavior.
@spec get_lock(String.t(), atom()) :: {:ok, map()} | {:error, Kevo.ApiError.t()}
Retrieves the given lock's state.
@spec get_locks(atom()) :: {:ok, [map()]} | {:error, Kevo.ApiError.t()}
Retrieves all locks visible to the logged in user.
@spec lock(String.t(), atom()) :: :ok | {:error, Kevo.ApiError.t()}
Locks the given lock.
@spec start_link(opts :: keyword()) :: Supervisor.on_start()
Starts an instance of kevo_ex.
Configuration
:name
- Alias of the top-level supervisor. Can be provided if you intend to run multiple instances ofkevo_ex
in your app. Defaults toKevo
.:username
- Your Kevo username (required).:password
- Your Kevo password (required).:ws_callback_module
- Websocket callback module. Defaults tonil
.
@spec unlock(String.t(), atom()) :: :ok | {:error, Kevo.ApiError.t()}
Unlocks the given lock.