package eliom
Install
Dune Dependency
Authors
Maintainers
Sources
md5=c8c67fe5fb8d3f44a3b17cc4a93a0e62
sha512=e58557a1b525efd011e0eb539b112b53e6c012ac3fb2153c251be030eda483dd3b19de625707cf5ffebd97fa6a7fabfb8a6aae8e8a61c79e0bd7ad2d289df9a9
doc/eliom.server/Eliom_service_base/index.html
Module Eliom_service_base
Source
include module type of struct include Types end
Auxiliary service-related types
type ('get, 'tipo, 'gn) params = ('get, 'tipo, 'gn) Eliom_parameter.params_type constraint 'tipo = [< `WithSuffix | `WithoutSuffix ]
Method specification
type ('m, _, _, _, _, _, _) meth = ('m, _, _, _, _, _, _) Types.meth =
| Get : ('gp, 'tipo, 'gn) params -> (get, 'gp, 'gn, unit, unit, 'tipo, unit) meth
| Post : ('gp, 'tipo, 'gn) params * ('pp, [ `WithoutSuffix ], 'pn) params -> (post, 'gp, 'gn, 'pp, 'pn, 'tipo, 'gp) meth
| Put : ('gp, 'tipo, 'gn) params -> (put, 'gp, 'gn, Eliom_parameter.raw_post_data, Eliom_parameter.no_param_name, 'tipo, unit) meth
| Delete : ('gp, 'tipo, 'gn) params -> (delete, 'gp, 'gn, Eliom_parameter.raw_post_data, Eliom_parameter.no_param_name, 'tipo, unit) meth
Method specification datatype
An Eliom service (see Eliom_service_sigs.S.t
) can respond to one of the following HTTP methods:
- GET (
Get g
) - POST (
Post (g, p)
) - PUT (
Put g
) - DELETE (
Delete g
)
In all cases, the service parameters need to be provided (see Eliom_parameter_sigs.S
). POST (Post (g, p)
) services accept both GET (g
) and POST (p
) parameters. For the other methods, only GET (g
) parameters apply.
The type parameters are used to impose various type constraints, and are not necessarily of interest to the programmer. Their technical meaning is as follows.
- 0-th param : method
- params 1-4 : GET and POST parameter types and names
- param 5 : suffix parameters permitted or not
- param 6 : non-unit only for the
Post (g, p)
case wheng
is not unit ; used to force unit GET parameters when needed
type 'm which_meth = 'm Types.which_meth =
| Get' : get which_meth
| Post' : post which_meth
| Put' : put which_meth
| Delete' : delete which_meth
Like meth
but without the parameters
module Url = Eliom_lib.Url
val which_meth_internal :
'm 'gp 'gn 'pp 'pn 'tipo 'x. ('m, 'gp, 'gn, 'pp, 'pn, 'tipo, 'x) meth ->
'm which_meth
type 'a attached_info =
| Attached : att -> att attached_info
| Nonattached : non_att -> non_att attached_info
type send_appl_content =
| XNever
| XAlways
| XSame_appl of string * string option
(*Whether the service is capable to send application content or not. (application content has type Eliom_service.eliom_appl_answer: content of the application container, or xhr redirection ...). A link towards a service with send_appl_content = XNever will always answer a regular http frame (this will stop the application if used in a regular link or form, but not with XHR). XAlways means "for all applications" (like redirections/actions). XSame_appl means "only for this application". If there is a client side application, and the service has XAlways or XSame_appl when it is the same application, then the link (or form or change_page) will expect application content.
*)
type ('get, 'post, 'meth, 'attached, 'co, 'ext, 'reg, +'tipo, 'getnames, 'postnames, 'rt)
t =
{
pre_applied_parameters : (string * Eliommod_parameters.param) list Eliom_lib.String.Table.t * (string * Eliommod_parameters.param) list;
get_params_type : ('get, 'tipo, 'getnames) Eliom_parameter.params_type;
post_params_type : ('post, [ `WithoutSuffix ], 'postnames) Eliom_parameter.params_type;
max_use : int option;
timeout : float option;
meth : 'meth which_meth;
kind : service_kind;
info : 'attached attached_info;
https : bool;
keep_nl_params : [ `All | `Persistent | `None ];
mutable send_appl_content : send_appl_content;
mutable client_fun : ('get -> 'post -> result Lwt.t) option ref Eliom_client_value.t option;
mutable reload_fun : reload_fun;
service_mark : (unit, unit, 'meth, 'attached, 'co, 'ext, 'reg, suff, unit, unit, unit) t Eliom_common.wrapper;
} constraint 'tipo = [< suff ]
val pre_applied_parameters :
('a, 'b, 'c, 'd, 'e, 'f, 'g, [< suff ], 'h, 'i, 'j) t ->
(string * Eliommod_parameters.param) list Eliom_lib.String.Table.t
* (string * Eliommod_parameters.param) list
val get_params_type :
('a, 'b, 'c, 'd, 'e, 'f, 'g, [< suff ] as 'h, 'i, 'j, 'k) t ->
('a, 'h, 'i) Eliom_parameter.params_type
val post_params_type :
('a, 'b, 'c, 'd, 'e, 'f, 'g, [< suff ], 'h, 'i, 'j) t ->
('b, [ `WithoutSuffix ], 'i) Eliom_parameter.params_type
val static_dir_ :
?https:bool ->
unit ->
(string list,
unit,
get,
att,
'a,
'b,
'c,
[ `WithSuffix ],
[ `One of string list ] Eliom_parameter.param_name,
unit,
'd)
t
Static directories *
val static_dir :
unit ->
(string list,
unit,
get,
att,
'a,
'b,
'c,
[ `WithSuffix ],
[ `One of string list ] Eliom_parameter.param_name,
unit,
'd)
t
val https_static_dir :
unit ->
(string list,
unit,
get,
att,
'a,
'b,
'c,
[ `WithSuffix ],
[ `One of string list ] Eliom_parameter.param_name,
unit,
'd)
t
val get_static_dir_ :
?https:bool ->
?keep_nl_params:[ `All | `None | `Persistent ] ->
get_params:('a, [ `WithoutSuffix ], 'b) Eliom_parameter.params_type ->
unit ->
(string list * 'a,
unit,
get,
att,
'c,
'd,
'e,
[ `WithSuffix ],
[ `One of string list ] Eliom_parameter.param_name * 'b,
unit,
'f)
t
val static_dir_with_params :
?keep_nl_params:[ `All | `None | `Persistent ] ->
get_params:('a, [ `WithoutSuffix ], 'b) Eliom_parameter.params_type ->
unit ->
(string list * 'a,
unit,
get,
att,
'c,
'd,
'e,
[ `WithSuffix ],
[ `One of string list ] Eliom_parameter.param_name * 'b,
unit,
'f)
t
val https_static_dir_with_params :
?keep_nl_params:[ `All | `None | `Persistent ] ->
get_params:('a, [ `WithoutSuffix ], 'b) Eliom_parameter.params_type ->
unit ->
(string list * 'a,
unit,
get,
att,
'c,
'd,
'e,
[ `WithSuffix ],
[ `One of string list ] Eliom_parameter.param_name * 'b,
unit,
'f)
t
val send_appl_content :
('a, 'b, 'c, 'd, 'e, 'f, 'g, [< suff ], 'h, 'i, 'j) t ->
send_appl_content
val set_send_appl_content :
('a, 'b, 'c, 'd, 'e, 'f, 'g, [< suff ], 'h, 'i, 'j) t ->
send_appl_content ->
unit
val add_non_localized_get_parameters :
params:('a, [ `WithoutSuffix ], 'b) Eliom_parameter.non_localized_params ->
service:('c, 'd, 'e, 'f, 'g, 'h, 'i, [< suff ] as 'j, 'k, 'l, 'm) t ->
('c * 'a, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k * 'b, 'l, 'n) t
val add_non_localized_post_parameters :
params:('a, [ `WithoutSuffix ], 'b) Eliom_parameter.non_localized_params ->
service:('c, 'd, 'e, 'f, 'g, 'h, 'i, [< suff ] as 'j, 'k, 'l, 'm) t ->
('c, 'd * 'a, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l * 'b, 'n) t
type (_, _, _) path_option =
| Path : Eliom_lib.Url.path -> (att, non_co, _) path_option
| No_path : (non_att, co, unit) path_option
val main_service :
https:bool ->
prefix:string ->
path:Url.path ->
?force_site_dir:string list ->
kind:service_kind ->
meth:'a which_meth ->
?redirect_suffix:bool ->
?keep_nl_params:[ `All | `None | `Persistent ] ->
?priority:int ->
get_params:('b, [< suff ] as 'c, 'd) Eliom_parameter.params_type ->
post_params:('e, [ `WithoutSuffix ], 'f) Eliom_parameter.params_type ->
reload_fun:reload_fun ->
unit ->
('b, 'e, 'a, att, 'g, 'h, 'i, 'c, 'd, 'f, 'j) t
Create a main service (not a coservice), internal or external