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.

Link to this function

get_events(lock_id, page \\ 1, page_size \\ 10, name \\ Kevo)

View Source
@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.

Link to this function

get_lock(lock_id, name \\ Kevo)

View Source
@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.

Link to this function

lock(lock_id, name \\ Kevo)

View Source
@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 of kevo_ex in your app. Defaults to Kevo.

  • :username - Your Kevo username (required).

  • :password - Your Kevo password (required).

  • :ws_callback_module - Websocket callback module. Defaults to nil.

Link to this function

unlock(lock_id, name \\ Kevo)

View Source
@spec unlock(String.t(), atom()) :: :ok | {:error, Kevo.ApiError.t()}

Unlocks the given lock.