This is client API (go to server)

Module Eliom_service

module Eliom_service : sig..end

Functions to add non localised parameters to services and client side declaration of void coservices. Void coservices are the only ones defined on client side.


type suff = [ `WithSuffix | `WithoutSuffix ]

Types of services

type servcoserv = [ `Coservice | `Service ]
type getpost = [ `Get | `Post ]
type attached_service_kind = [ `External | `Internal of servcoserv ]
type internal = [ `Internal of servcoserv ]
type registrable = [ `Registrable | `Unregistrable ]
type (+'a, +'b) a_s

You can call register function only on registrable services

type +'a na_s
type service_kind = 
  [ `Attached of
   (attached_service_kind, getpost)
   a_s
  | `Nonattached of getpost na_s ]
type internal_service_kind = 
  [ `Attached of
   (internal, getpost) a_s
  | `Nonattached of getpost na_s ]
type get_service_kind = 
  [ `Attached of
   (attached_service_kind, [ `Get ]) a_s
  | `Nonattached of [ `Get ] na_s ]
type post_service_kind = 
  [ `Attached of
   (attached_service_kind, [ `Post ]) a_s
  | `Nonattached of [ `Post ] na_s ]
type attached = 
  [ `Attached of
   (attached_service_kind, getpost)
   a_s ]
type nonattached = [ `Nonattached of getpost na_s ]
type http
type appl_service

default return type for services

return type for service that are entry points for an application

type 
  ('a, 'b, +'c, +[< suff ], +'d, +'e
   , +[< registrable ], +'f)
service

Type of services.

  • 'a is the type of GET parameters expected by the service.
  • 'b is the type of POST parameters expected by the service.
  • 'c describes the services's kind: attached or non-attached, internal or external, GET only or with POST parameters. It is a subtype of Eliom_service.​service_kind.
  • 'd is a phantom type, subtype of Eliom_service.​suff stating the kind of parameters it uses: suffix or not.
  • 'e is the type of GET parameters names. See Eliom_parameter.​param_name and form generation functions (e. g. Eliom_registration.Html5.get_form).
  • 'f is the type of POST parameters names. See Eliom_parameter.​param_name and form generation functions (e. g. Eliom_registration.Html5.post_form).
  • 'g is a phantom type, subtype of Eliom_service.​registrable, telling if it is possible to register a handler on this service.
  • 'h is an information on what the service returns. See Eliom_registration.kind.
val void_coservice' : 
  (unit, unit, [> `Nonattached of 'a na_s ],
   [ `WithoutSuffix ], unit, unit,
   [< registrable > `Unregistrable ], 'b)
  service

Void non-attached coservices

val https_void_coservice' : 
  (unit, unit, [> `Nonattached of 'a na_s ],
   [ `WithoutSuffix ], unit, unit,
   [< registrable > `Unregistrable ], 'b)
  service

A predefined non-attached action with special behaviour: it has no parameter at all, even non-attached parameters. Use it if you want to make a link to the current page without non-attached parameters. It is almost equivalent to a POST non-attached service without POST parameters, on which you register an action that does nothing, but you can use it with <a> links, not only forms. It does not keep non attached GET parameters.

val void_hidden_coservice' : 
  (unit, unit, [> `Nonattached of 'a na_s ],
   [ `WithoutSuffix ], unit, unit,
   [< registrable > `Unregistrable ], 'b)
  service

The same, but forcing https.

val https_void_hidden_coservice' : 
  (unit, unit, [> `Nonattached of 'a na_s ],
   [ `WithoutSuffix ], unit, unit,
   [< registrable > `Unregistrable ], 'b)
  service

Same as void_coservice' but keeps non attached GET parameters.

The same, but forcing https.

Miscellaneous

val add_non_localized_get_parameters : 
  params:('a, [ `WithoutSuffix ], 'b)
   Eliom_parameter.non_localized_params ->
  service:('c, 'd, 'e, [< suff ] as 'f, 'g, 'h,
   [< registrable ] as 'i, 'j)
   service ->
  ('c * 'a, 'd, 'e, 'f, 'g * 'b, 'h, 'i, 'j) service

Localized parameters

val add_non_localized_post_parameters : 
  params:('a, [ `WithoutSuffix ], 'b)
   Eliom_parameter.non_localized_params ->
  service:('c, 'd, 'e, [< suff ] as 'f, 'g, 'h,
   [< registrable ] as 'i, 'j)
   service ->
  ('c, 'd * 'a, 'e, 'f, 'g, 'h * 'b, 'i, 'j) service

Adds non localized GET parameters to a service

Adds non localized POST parameters to a service

Static files

val static_dir : 
  unit ->
  (string list, unit,
   [> `Attached of
   ([> `Internal of [> `Service ] ], [> `Get ]) a_s ],
   [ `WithSuffix ], [ `One of string list ] Eliom_parameter.param_name,
   unit, [< registrable > `Unregistrable ], 'a)
  service

The predefined service static_dir allows one to create links to static files. This service takes the name of a static file as a parameter (a string list, slash separated). The actual directory in filesystem where static pages will be found must be set up in the configuration file with the staticmod extension.

val https_static_dir : 
  unit ->
  (string list, unit,
   [> `Attached of
   ([> `Internal of [> `Service ] ], [> `Get ]) a_s ],
   [ `WithSuffix ], [ `One of string list ] Eliom_parameter.param_name,
   unit, [< registrable > `Unregistrable ], 'a)
  service

Same as Eliom_service.​static_dir but forcing https link.

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,
   [> `Attached of
   ([> `Internal of [> `Service ] ], [> `Get ]) a_s ],
   [ `WithSuffix ],
   [ `One of string list ] Eliom_parameter.param_name * 'b, unit,
   [< registrable > `Unregistrable ], 'c)
  service

Like static_dir, but allows one to put GET parameters

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,
   [> `Attached of
   ([> `Internal of [> `Service ] ], [> `Get ]) a_s ],
   [ `WithSuffix ],
   [ `One of string list ] Eliom_parameter.param_name * 'b, unit,
   [< registrable > `Unregistrable ], 'c)
  service

Same as Eliom_service.​static_dir_with_params but forcing https link.