package ez_api

  1. Overview
  2. Docs
module StringMap : sig ... end
module Timings : sig ... end
module Directory : sig ... end
module Answer : sig ... end
module Req = EzAPI.Req
module File : sig ... end
module GMTime : sig ... end
module Ip : sig ... end

Server

type server_kind =
  1. | API of Directory.t
  2. | Root of string * string option
type server = {
  1. server_port : int;
  2. server_kind : server_kind;
}

Utils

val return : ?code:int -> ?headers:(string * string) list -> 'a -> 'a Answer.t Lwt.t
val return_ok : ?code:int -> ?headers:(string * string) list -> 'a -> ('a, 'b) result Answer.t Lwt.t
val return_error : ?content:'a -> ?headers:(string * string) list -> int -> ('b, 'a option) result Answer.t Lwt.t
val verbose : int ref
val set_verbose : int -> unit
val pp_time : unit -> string
val debug : ?v:int -> ('a, unit, string, unit) format4 -> 'a
val debugf : ?v:int -> (unit -> unit) -> unit

Register Handler

val empty : 'a Directory.directory
val register_res : ('a, 'b, 'c, 'd, [< EzAPI.Security.scheme ] as 'e) EzAPI.service -> ('a -> 'e list -> 'b -> ('c, 'd) result Answer.t Lwt.t) -> Directory.t -> (Directory.t, Directory.Step.t list * Directory.conflict) result
val register_ws_res : ('a, 'b, 'c, 'd, [< EzAPI.Security.scheme ] as 'e) EzAPI.service -> react:('a -> 'e list -> 'b -> ('c, 'd) result Lwt.t) -> bg:('a -> 'e list -> (('c, 'd) result -> unit) -> unit Lwt.t) -> ?onclose:('a -> unit Lwt.t) -> ?step:float -> Directory.t -> (Directory.t, Directory.Step.t list * Directory.conflict) result
exception Conflict of Directory.Step.t list * Directory.conflict
val register : ('a, 'b, 'c, 'd, [< EzAPI.Security.scheme ] as 'e) EzAPI.service -> ('a -> 'e list -> 'b -> ('c, 'd) result Answer.t Lwt.t) -> Directory.t -> Directory.t
val register_ws : ('a, 'b, 'c, 'd, [< EzAPI.Security.scheme ] as 'e) EzAPI.service -> ?onclose:('a -> unit Lwt.t) -> ?step:float -> react:('a -> 'e list -> 'b -> ('c, 'd) result Lwt.t) -> bg:('a -> 'e list -> (('c, 'd) result -> unit) -> unit Lwt.t) -> Directory.t -> Directory.t
module Legacy : sig ... end
val handle : ?meth: [< `DELETE | `GET | `HEAD | `OPTIONS | `PATCH | `POST | `PUT GET OPTIONS ] -> ?content_type:string -> ?ws: (?onclose:(unit -> unit Lwt.t) -> ?step:float -> react: (string -> (Directory.ws_frame, Directory.handler_error) result Lwt.t) -> bg: (((Directory.ws_frame, Directory.handler_error) result -> unit) -> unit Lwt.t) -> Uuidm.t -> 'a Lwt.t) -> server_kind -> Req.t -> string list -> string -> [> `http of string Answer.t | `ws of 'a ] Lwt.t
val default_access_control_headers : (string * string) list
val merge_headers_with_default : (string * string) list -> (string * string) list
OCaml

Innovation. Community. Security.