Lab v0.2.2-dev Lab.API.Adapter behaviour View Source

Lab Adapter Specification

Link to this section Summary

Link to this section Types

Link to this type config() View Source
config() :: map()
Link to this type id() View Source
id() :: integer()
Link to this type params() View Source
params() :: list()
Link to this type resource() View Source
resource() :: :atom

Link to this section Callbacks

Link to this callback all(resource, params, config) View Source
all(resource(), params(), config()) :: {:ok, term()} | {:error, map()}

Index a resource

Link to this callback create(resource, params, config) View Source
create(resource(), params(), config()) ::
  {:ok, term()} |
  {:error, map()}

Create a resource

Link to this callback delete(resource, id, params, config) View Source
delete(resource(), id(), params(), config()) ::
  {:ok} |
  {:error, map()}

Delete a resource

Link to this callback get(resource, id, params, config) View Source
get(resource(), id(), params(), config()) ::
  {:ok, term()} |
  {:error, map()}

Read a resource

Link to this callback update(resource, id, params, config) View Source
update(resource(), id(), params(), config()) ::
  {:ok, term()} |
  {:error, map()}

Update a resource