package sihl
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=8a2754d6e5b9eafb8ff332abdb1ceb7d
sha512=3230a1315686b0b6f90a41ceda27ab036e178184ab13d5a98f64d6d987caf4a8a5d94ed78bc8e79b0ee3b40ccbb1dbdc71ffe171f1aef1f18aba81fc720e3a1b
doc/sihl/Sihl/Web/Rest/module-type-SERVICE/index.html
Module type Rest.SERVICESource
The SERVICE interface has to be implemented by a CRUD service that drives the resource with its business logic.
t is the type of the resource.
val search :
?filter:string ->
?sort:[ `Desc | `Asc ] ->
?limit:int ->
?offset:int ->
unit ->
(t list * int) Lwt.tsearch ?filter ?sort ?limit ?offset () returns a subset of the whole collection of t. The returned tuple consist of the resulting subset and the total number of t stored.
filter is an optional keyword that is used to apply a filter. Only items are shown where t contains filter in some form. The exact implementation is open, but filter should be used as general search keyword.
sort describes whether the result is sorted in descending or ascending order. The field that is sorted by and the default value are defined by the implementation for security reason.
limit is the number of t in the resulting subset. A sane default is defined by the implementation.
offset is the number of t skipped before the resulting subset. A sane default is defined by the implementation.
insert t inserts t and returns an error message that can be shown to the user if it fails.
update id t updates the t that is found using its id with t and returns an error message that can be shown to the user if it fails.
This function is similar to insert and it overwrites an existing t.