package ocsigenserver

  1. Overview
  2. Docs
exception Unknown_command
val register_command_function : ?prefix:string -> (string -> string list -> unit Lwt.t) -> unit
val get_command_function : unit -> ?prefix:string -> string -> string list -> unit Lwt.t
exception Ocsigen_http_error of Ocsigen_cookie_map.t * Cohttp.Code.status
exception Bad_config_tag_for_extension of string
exception Error_in_config_file of string
exception Error_in_user_config_file of string
type file_info = Ocsigen_multipart.file_info = {
  1. tmp_filename : string;
  2. filesize : int64;
  3. raw_original_filename : string;
  4. file_content_type : ((string * string) * (string * string) list) option;
}
val badconfig : ('a, unit, string, 'b) format4 -> 'a
type virtual_hosts = (string * Pcre.regexp * int option) list
val hash_virtual_hosts : virtual_hosts -> int
val equal_virtual_hosts : virtual_hosts -> virtual_hosts -> bool
val host_match : virtual_hosts:virtual_hosts -> host:string option -> port:int -> bool
type do_not_serve = {
  1. do_not_serve_regexps : string list;
  2. do_not_serve_files : string list;
  3. do_not_serve_extensions : string list;
}
val serve_everything : do_not_serve
exception IncorrectRegexpes of do_not_serve
val do_not_serve_to_regexp : do_not_serve -> Pcre.regexp
val join_do_not_serve : do_not_serve -> do_not_serve -> do_not_serve
type config_info = {
  1. default_hostname : string;
  2. default_httpport : int;
  3. default_httpsport : int;
  4. default_protocol_is_https : bool;
  5. mime_assoc : Ocsigen_charset_mime.mime_assoc;
  6. charset_assoc : Ocsigen_charset_mime.charset_assoc;
  7. default_directory_index : string list;
  8. list_directory_content : bool;
  9. do_not_serve_404 : do_not_serve;
  10. do_not_serve_403 : do_not_serve;
  11. uploaddir : string option;
  12. maxuploadfilesize : int64 option;
}
val default_config_info : unit -> config_info
type request = {
  1. request_info : Ocsigen_request.t;
  2. request_config : config_info;
}
exception Ocsigen_is_dir of Ocsigen_request.t -> Uri.t
type answer =
  1. | Ext_do_nothing
  2. | Ext_found of unit -> Ocsigen_response.t Lwt.t
  3. | Ext_found_stop of unit -> Ocsigen_response.t Lwt.t
  4. | Ext_next of Cohttp.Code.status
  5. | Ext_stop_site of Ocsigen_cookie_map.t * Cohttp.Code.status
  6. | Ext_stop_host of Ocsigen_cookie_map.t * Cohttp.Code.status
  7. | Ext_stop_all of Ocsigen_cookie_map.t * Cohttp.Code.status
  8. | Ext_continue_with of request * Ocsigen_cookie_map.t * Cohttp.Code.status
  9. | Ext_retry_with of request * Ocsigen_cookie_map.t
  10. | Ext_sub_result of extension_composite
  11. | Ext_found_continue_with of unit -> (Ocsigen_response.t * request) Lwt.t
  12. | Ext_found_continue_with' of Ocsigen_response.t * request
and request_state =
  1. | Req_not_found of Cohttp.Code.status * request
  2. | Req_found of request * Ocsigen_response.t
type extension = request_state -> answer Lwt.t
type parse_fun = Xml.xml list -> extension_composite
type parse_host
type userconf_info = {
  1. localfiles_root : string;
}
type parse_config = userconf_info option -> virtual_hosts -> config_info -> parse_config_aux
and parse_config_aux = Ocsigen_lib.Url.path -> parse_host -> parse_fun -> Xml.xml -> extension
val register : name:string -> ?fun_site:parse_config -> ?end_init:(unit -> unit) -> ?init_fun:(Xml.xml list -> unit) -> ?exn_handler:(exn -> string) -> ?respect_pipeline:bool -> unit -> unit
module Configuration : sig ... end
val get_hostname : request -> string
val get_port : request -> int
val new_url_of_directory_request : request -> Ocsigen_request.t -> Uri.t
exception NoSuchUser
type ud_string
val parse_user_dir : string -> ud_string
val replace_user_dir : Pcre.regexp -> ud_string -> string -> string
exception Not_concerned
val find_redirection : Pcre.regexp -> bool -> string -> Ocsigen_request.t -> string
val preprocess_site_path : Ocsigen_lib.Url.path -> Ocsigen_lib.Url.path
val compose : extension list -> extension_composite
val make_parse_config : Ocsigen_lib.Url.path -> parse_config_aux -> parse_fun
val parse_config_item : parse_config
val set_hosts : (virtual_hosts * config_info * extension_composite) list -> unit
val get_hosts : unit -> (virtual_hosts * config_info * extension_composite) list
val compute_result : ?previous_cookies:Ocsigen_cookie_map.t -> Ocsigen_request.t -> Ocsigen_response.t Lwt.t
val get_number_of_connected : unit -> int
val during_initialisation : unit -> bool
val start_initialisation : unit -> unit
val end_initialisation : unit -> unit
val get_numberofreloads : unit -> int
val get_init_exn_handler : unit -> exn -> string
val set_config : Xml.xml list -> unit
OCaml

Innovation. Community. Security.