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

Lab Specification

Link to this section Summary

Callbacks

Index a resource

Create a resource

Delete a resource

Read a resource

Update a resource

Link to this section Types

Link to this type id() View Source
id() :: integer()
Link to this type model() View Source
model() :: :atom
Link to this type params() View Source
params() :: list()

Link to this section Callbacks

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

Index a resource

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

Create a resource

Link to this callback delete(model, params) View Source
delete(model(), params()) :: {:ok, term()} | {:error, map()}

Delete a resource

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

Read a resource

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

Update a resource