Skip to content

Commit

Permalink
Static linking: improve API doc of extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
balat committed Aug 21, 2024
1 parent 24a1744 commit 932ab7a
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 9 deletions.
20 changes: 16 additions & 4 deletions src/extensions/authbasic.mli
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)

val section : Lwt_log_core.section
(** use Lwt_log.Section.set_level in order to debug *)
(** Authbasic: Basic HTTP authentication *)

(** Module [Authbasic]: Basic HTTP Authentication. *)
(** If you want to use this extension with Ocsigen Server's configuration file,
+ have a look at the <<a_manual chapter="authbasic"|manual page>>.
+ If you are using Ocsigen Server as a library, use the interface described
+ here. Each of these functions behaves exactly as its configuration file
counterpart.
+*)

type auth = string -> string -> bool Lwt.t
(**
This module belongs to ocamlfind package
[ocsigenserver.ext.authbasic].
*)

(** This module implements Basic HTTP Authentication as described in
{{:http://www.ietf.org/rfc/rfc2617.txt}RFC 2617}. It can be used
Expand All @@ -37,6 +44,11 @@ type auth = string -> string -> bool Lwt.t
very naive one (authentication with a single user/password, given
in the configuration file) is provided. *)

val section : Lwt_log_core.section
(** use Lwt_log.Section.set_level in order to set the log level *)

type auth = string -> string -> bool Lwt.t

val register_basic_authentication_method : (Xml.xml -> auth) -> unit
(** This function registers an authentication plugin: it adds a new
parser to the list of available authentication schemes.
Expand Down
16 changes: 16 additions & 0 deletions src/extensions/cors.mli
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
(** Cross-Origin Resource Sharing *)

(** If you want to use this extension with Ocsigen Server's configuration file,
+ have a look at the <<a_manual chapter="cors"|manual page>>.
+ If you are using Ocsigen Server as a library, use the interface described
+ here. Each of these functions behaves exactly as its configuration file
counterpart.
+*)

(**
This module belongs to ocamlfind package
[ocsigenserver.ext.cors].
*)

val run :
?credentials:bool
-> ?max_age:int
-> ?exposed_headers:string list
-> ?methods:Cohttp.Code.meth list
-> unit
-> Ocsigen_server.instruction
(** [run] makes it possible to use this extension without
configuration file. *)
22 changes: 20 additions & 2 deletions src/extensions/deflatemod.mli
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
val section : Lwt_log_core.section
(** use Lwt_log.Section.set_level in order to debug *)
(** Deflatemod: compress output data *)

(** If you want to use this extension with Ocsigen Server's configuration file,
+ have a look at the <<a_manual chapter="deflatemod"|manual page>>.
+ If you are using Ocsigen Server as a library, use the interface described
+ here. Each of these functions behaves exactly as its configuration file
counterpart.
+*)

(**
This module belongs to ocamlfind package
[ocsigenserver.ext.deflatemod].
*)

val set_compress_level : int -> unit
val set_buffer_size : int -> unit

type filter = [`Type of string option * string option | `Extension of string]
(** Describes the content to deflate, either using its content type,
or file extension *)

val run :
mode:[`All_but of filter list | `Only of filter list]
-> unit
-> Ocsigen_server.instruction
(** [run ~mode ()] makes it possible to use this extension without
configuration file. *)

val section : Lwt_log_core.section
(** Use Lwt_log.Section.set_level in order to change the log level *)
16 changes: 16 additions & 0 deletions src/extensions/outputfilter.mli
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
(** Outputfilter: Rewrite some part of the output *)

(** If you want to use this extension with Ocsigen Server's configuration file,
+ have a look at the <<a_manual chapter="outputfilter"|manual page>>.
+ If you are using Ocsigen Server as a library, use the interface described
+ here. Each of these functions behaves exactly as its configuration file
counterpart.
+*)

(**
This module belongs to ocamlfind package
[ocsigenserver.ext.outputfilter].
*)

val run :
mode:
[ `Rewrite of Ocsigen_header.Name.t * Re.Pcre.regexp * string
| `Add of Ocsigen_header.Name.t * string * bool option
| `Code of Cohttp.Code.status ]
-> unit
-> Ocsigen_server.instruction
(** [run ~mode ()] makes it possible to use this extension without
configuration file. *)
18 changes: 17 additions & 1 deletion src/extensions/redirectmod.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
(** Redirectmod: HTTP redirections *)

(** If you want to use this extension with Ocsigen Server's configuration file,
+ have a look at the <<a_manual chapter="redirectmod"|manual page>>.
+ If you are using Ocsigen Server as a library, use the interface described
+ here. Each of these functions behaves exactly as its configuration file
counterpart.
+*)

(**
This module belongs to ocamlfind package
[ocsigenserver.ext.redirectmod].
*)

val section : Lwt_log_core.section
(** use Lwt_log.Section.set_level in order to debug *)
(** use Lwt_log.Section.set_level in order to set the log level *)

type redirection

Expand All @@ -11,3 +25,5 @@ val create_redirection :
-> redirection

val run : redirection:redirection -> unit -> Ocsigen_server.instruction
(** [run ~redirection ()] makes it possible to use this extension without
configuration file. *)
18 changes: 17 additions & 1 deletion src/extensions/revproxy.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
(** Revproxy: Forward a request to another Web server *)

(** If you want to use this extension with Ocsigen Server's configuration file,
+ have a look at the <<a_manual chapter="revproxy"|manual page>>.
+ If you are using Ocsigen Server as a library, use the interface described
+ here. Each of these functions behaves exactly as its configuration file
counterpart.
+*)

(**
This module belongs to ocamlfind package
[ocsigenserver.ext.revproxy].
*)

val section : Lwt_log_core.section
(** use Lwt_log.Section.set_level in order to debug *)
(** use Lwt_log.Section.set_level in order to set the log level *)

type redirection

Expand All @@ -12,3 +26,5 @@ val create_redirection :
-> redirection

val run : redirection:redirection -> unit -> Ocsigen_server.instruction
(** [run ~redirection ()] makes it possible to use this extension without
configuration file. *)
18 changes: 17 additions & 1 deletion src/extensions/rewritemod.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
(** Rewrite: Change the request *)

(** If you want to use this extension with Ocsigen Server's configuration file,
+ have a look at the <<a_manual chapter="rewritemod"|manual page>>.
+ If you are using Ocsigen Server as a library, use the interface described
+ here. Each of these functions behaves exactly as its configuration file
counterpart.
+*)

(**
This module belongs to ocamlfind package
[ocsigenserver.ext.rewritemod].
*)

val section : Lwt_log_core.section
(** use Lwt_log.Section.set_level in order to debug *)
(** use Lwt_log.Section.set_level in order to set the log level *)

val run :
?continue:bool
Expand All @@ -8,3 +22,5 @@ val run :
-> string
-> unit
-> Ocsigen_server.instruction
(** [run ~realm ~auth ()] makes it possible to use this extension without
configuration file. *)

0 comments on commit 932ab7a

Please sign in to comment.