package sihl

  1. Overview
  2. Docs
The Sihl web framework

Install

dune-project
 Dependency

Authors

Maintainers

Sources

2.0.1.tar.gz
md5=52b28d3faac0a2243735285aa3f962aa
sha512=e7ff89bdba9f1afa3b115a056ae3d403f602685187a968485ea64a7cd1a18791f66b7480b682bf66acd3564dd89139162779d58a43c2389d785c98e246094a18

doc/sihl/Sihl/Web/Rest/module-type-CONTROLLER/index.html

Module type Rest.CONTROLLERSource

A module of type CONTROLLER can be used to create a resource with resource_of_controller. Use a controller instead of a service and a view if you need low level control.

Sourcetype t

t is the type of the resource.

Sourceval index : string -> Rock.Request.t -> Rock.Response.t Lwt.t

index name request returns a list of all resource instances as a response.

name is the name of the resource in plural, for example orders or users.

Sourceval new' : ?key:string -> string -> Rock.Request.t -> Rock.Response.t Lwt.t

new' ?key name request returns a form to create instances of the resource as a response.

name is the name of the resource in plural, for example orders or users.

The form data is stored in the flash storage under the key. By default, the value is _form.

Sourceval create : string -> ('a, 'b, t) Conformist.t -> Rock.Request.t -> Rock.Response.t Lwt.t

create name schema request handles the creation of new resource instances and returns the creation result as a response.

name is the name of the resource in plural, for example orders or users.

Sourceval show : string -> Rock.Request.t -> Rock.Response.t Lwt.t

show name request returns a single resource instance as a response.

name is the name of the resource in plural, for example orders or users.

Sourceval edit : ?key:string -> string -> Rock.Request.t -> Rock.Response.t Lwt.t

edit ?key name request returns a form to edit resource instances as a response.

name is the name of the resource in plural, for example orders or users.

The form data is stored in the flash storage under the key. By default, the value is _form.

Sourceval update : string -> ('a, 'b, t) Conformist.t -> Rock.Request.t -> Rock.Response.t Lwt.t

update name schema request handles the update of a resource instance and returns the update result as a response.

name is the name of the resource in plural, for example orders or users.

Sourceval delete' : string -> Rock.Request.t -> Rock.Response.t Lwt.t

delete name request handles the deletion of a resource instance and returns the deletion result as a response.

name is the name of the resource in plural, for example orders or users.