From 8941b378063100227a7716075c98edc88a0527d7 Mon Sep 17 00:00:00 2001 From: c-cube Date: Tue, 8 Aug 2023 20:42:58 +0000 Subject: [PATCH] deploy: 402e3f72e453b624a96f7466472811622682cd66 --- dev/tiny_httpd/Tiny_httpd/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_html_/A/index.html | 2 -- dev/tiny_httpd/Tiny_httpd_html_/Out/index.html | 2 -- dev/tiny_httpd/Tiny_httpd_io/Input/index.html | 2 -- dev/tiny_httpd/Tiny_httpd_io/Output/index.html | 2 -- dev/tiny_httpd/Tiny_httpd_io/TCP_server/index.html | 2 -- dev/tiny_httpd/Tiny_httpd_io/Writer/index.html | 2 -- dev/tiny_httpd/Tiny_httpd_server/index.html | 2 +- 8 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 dev/tiny_httpd/Tiny_httpd_html_/A/index.html delete mode 100644 dev/tiny_httpd/Tiny_httpd_html_/Out/index.html delete mode 100644 dev/tiny_httpd/Tiny_httpd_io/Input/index.html delete mode 100644 dev/tiny_httpd/Tiny_httpd_io/Output/index.html delete mode 100644 dev/tiny_httpd/Tiny_httpd_io/TCP_server/index.html delete mode 100644 dev/tiny_httpd/Tiny_httpd_io/Writer/index.html diff --git a/dev/tiny_httpd/Tiny_httpd/index.html b/dev/tiny_httpd/Tiny_httpd/index.html index 867da8e8..7b794442 100644 --- a/dev/tiny_httpd/Tiny_httpd/index.html +++ b/dev/tiny_httpd/Tiny_httpd/index.html @@ -76,7 +76,7 @@ echo: stage:[ `Encoding | `Stage of int ] -> t -> Middleware.t -> - unit

Add a middleware to every request/response pair.

Request handlers
val set_top_handler : t -> (string Request.t -> Response.t) -> unit

Setup a handler called by default.

This handler is called with any request not accepted by any handler installed via add_path_handler. If no top handler is installed, unhandled paths will return a 404 not found.

val add_route_handler : + unit

Add a middleware to every request/response pair.

  • parameter stage

    specify when middleware applies. Encoding comes first (outermost layer), then stages in increasing order.

  • raises Invalid_argument

    if stage is `Stage n where n < 1

  • since 0.11
Request handlers
val set_top_handler : t -> (byte_stream Request.t -> Response.t) -> unit

Setup a handler called by default.

This handler is called with any request not accepted by any handler installed via add_path_handler. If no top handler is installed, unhandled paths will return a 404 not found.

val add_route_handler : ?accept:(unit Request.t -> (unit, Response_code.t * string) Stdlib.result) -> ?middlewares:Middleware.t list -> ?meth:Meth.t -> diff --git a/dev/tiny_httpd/Tiny_httpd_html_/A/index.html b/dev/tiny_httpd/Tiny_httpd_html_/A/index.html deleted file mode 100644 index 76232721..00000000 --- a/dev/tiny_httpd/Tiny_httpd_html_/A/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -A (tiny_httpd.Tiny_httpd_html_.A)

Module Tiny_httpd_html_.A

Attributes.

This module contains combinator for the standard attributes. One can also just use a pair of strings.

type t = string -> attribute

Attribute builder

val accept : t

Attribute "accept".

val accept_charset : t

Attribute "accept-charset".

val accesskey : t

Attribute "accesskey".

val action : t

Attribute "action".

val align : t

Attribute "align".

val allow : t

Attribute "allow".

val alt : t

Attribute "alt".

val async : t

Attribute "async".

val autocapitalize : t

Attribute "autocapitalize".

val autocomplete : t

Attribute "autocomplete".

val autofocus : t

Attribute "autofocus".

val autoplay : t

Attribute "autoplay".

val buffered : t

Attribute "buffered".

val capture : t

Attribute "capture".

val challenge : t

Attribute "challenge".

val charset : t

Attribute "charset".

val checked : t

Attribute "checked".

val cite : t

Attribute "cite".

val class_ : t

Attribute "class".

val code : t

Attribute "code".

val codebase : t

Attribute "codebase".

val cols : t

Attribute "cols".

val colspan : t

Attribute "colspan".

val content : t

Attribute "content".

val contenteditable : t

Attribute "contenteditable".

val contextmenu : t

Attribute "contextmenu".

val controls : t

Attribute "controls".

val coords : t

Attribute "coords".

val crossorigin : t

Attribute "crossorigin".

val csp : t

Attribute "csp".

val data : t

Attribute "data".

val data_star : t

Attribute "data-*".

val datetime : t

Attribute "datetime".

val decoding : t

Attribute "decoding".

val default : t

Attribute "default".

val defer : t

Attribute "defer".

val dir : t

Attribute "dir".

val dirname : t

Attribute "dirname".

val disabled : t

Attribute "disabled".

val download : t

Attribute "download".

val draggable : t

Attribute "draggable".

val enctype : t

Attribute "enctype".

val enterkeyhint : t

Attribute "enterkeyhint".

val for_ : t

Attribute "for".

val form : t

Attribute "form".

val formaction : t

Attribute "formaction".

val formenctype : t

Attribute "formenctype".

val formmethod : t

Attribute "formmethod".

val formnovalidate : t

Attribute "formnovalidate".

val formtarget : t

Attribute "formtarget".

val headers : t

Attribute "headers".

val hidden : t

Attribute "hidden".

val high : t

Attribute "high".

val href : t

Attribute "href".

val hreflang : t

Attribute "hreflang".

val http_equiv : t

Attribute "http-equiv".

val icon : t

Attribute "icon".

val id : t

Attribute "id".

val importance : t

Attribute "importance".

val integrity : t

Attribute "integrity".

val ismap : t

Attribute "ismap".

val itemprop : t

Attribute "itemprop".

val keytype : t

Attribute "keytype".

val kind : t

Attribute "kind".

val label : t

Attribute "label".

val lang : t

Attribute "lang".

val language : t

Attribute "language".

val list : t

Attribute "list".

val loop : t

Attribute "loop".

val low : t

Attribute "low".

val manifest : t

Attribute "manifest".

val max : t

Attribute "max".

val maxlength : t

Attribute "maxlength".

val minlength : t

Attribute "minlength".

val media : t

Attribute "media".

val method_ : t

Attribute "method".

val min : t

Attribute "min".

val multiple : t

Attribute "multiple".

val muted : t

Attribute "muted".

val name : t

Attribute "name".

val novalidate : t

Attribute "novalidate".

val open_ : t

Attribute "open".

val optimum : t

Attribute "optimum".

val pattern : t

Attribute "pattern".

val ping : t

Attribute "ping".

val placeholder : t

Attribute "placeholder".

val poster : t

Attribute "poster".

val preload : t

Attribute "preload".

val radiogroup : t

Attribute "radiogroup".

val readonly : t

Attribute "readonly".

val referrerpolicy : t

Attribute "referrerpolicy".

val rel : t

Attribute "rel".

val required : t

Attribute "required".

val reversed : t

Attribute "reversed".

val rows : t

Attribute "rows".

val rowspan : t

Attribute "rowspan".

val sandbox : t

Attribute "sandbox".

val scope : t

Attribute "scope".

val scoped : t

Attribute "scoped".

val selected : t

Attribute "selected".

val shape : t

Attribute "shape".

val size : t

Attribute "size".

val sizes : t

Attribute "sizes".

val slot : t

Attribute "slot".

val span : t

Attribute "span".

val spellcheck : t

Attribute "spellcheck".

val src : t

Attribute "src".

val srcdoc : t

Attribute "srcdoc".

val srclang : t

Attribute "srclang".

val srcset : t

Attribute "srcset".

val start : t

Attribute "start".

val step : t

Attribute "step".

val style : t

Attribute "style".

val summary : t

Attribute "summary".

val tabindex : t

Attribute "tabindex".

val target : t

Attribute "target".

val title : t

Attribute "title".

val translate : t

Attribute "translate".

val text : t

Attribute "Text".

val type_ : t

Attribute "type".

val usemap : t

Attribute "usemap".

val value : t

Attribute "value".

val width : t

Attribute "width".

val wrap : t

Attribute "wrap".

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html b/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html deleted file mode 100644 index 42f847eb..00000000 --- a/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Out (tiny_httpd.Tiny_httpd_html_.Out)

Module Tiny_httpd_html_.Out

Output for HTML combinators.

This output type is used to produce a string reasonably efficiently from a tree of combinators.

NOTE: this is experimental and an unstable API.

  • since 0.12
type t
val create_of_buffer : Stdlib.Buffer.t -> t
val create_of_out : Tiny_httpd_io.Output.t -> t
val flush : t -> unit
val add_char : t -> char -> unit
val add_string : t -> string -> unit
val add_format_nl : t -> unit
val with_no_format_nl : t -> (unit -> 'a) -> 'a
\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_io/Input/index.html b/dev/tiny_httpd/Tiny_httpd_io/Input/index.html deleted file mode 100644 index de36c737..00000000 --- a/dev/tiny_httpd/Tiny_httpd_io/Input/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Input (tiny_httpd.Tiny_httpd_io.Input)

Module Tiny_httpd_io.Input

Input channel (byte source)

type t = {
  1. input : bytes -> int -> int -> int;
    (*

    Read into the slice. Returns 0 only if the channel is closed.

    *)
  2. close : unit -> unit;
    (*

    Close the input. Must be idempotent.

    *)
}

An input channel, i.e an incoming stream of bytes.

This can be a string, an int_channel, an Unix.file_descr, a decompression wrapper around another input channel, etc.

val of_in_channel : ?close_noerr:bool -> Stdlib.in_channel -> t
val of_unix_fd : ?close_noerr:bool -> Unix.file_descr -> t
val input : t -> bytes -> int -> int -> int

Read into the given slice.

  • returns

    the number of bytes read, 0 means end of input.

val close : t -> unit

Close the channel.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_io/Output/index.html b/dev/tiny_httpd/Tiny_httpd_io/Output/index.html deleted file mode 100644 index 6ddcf430..00000000 --- a/dev/tiny_httpd/Tiny_httpd_io/Output/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Output (tiny_httpd.Tiny_httpd_io.Output)

Module Tiny_httpd_io.Output

Output channel (byte sink)

type t = {
  1. output_char : char -> unit;
    (*

    Output a single char

    *)
  2. output : bytes -> int -> int -> unit;
    (*

    Output slice

    *)
  3. flush : unit -> unit;
    (*

    Flush underlying buffer

    *)
  4. close : unit -> unit;
    (*

    Close the output. Must be idempotent.

    *)
}

An output channel, ie. a place into which we can write bytes.

This can be a Buffer.t, an out_channel, a Unix.file_descr, etc.

val of_out_channel : ?close_noerr:bool -> Stdlib.out_channel -> t

of_out_channel oc wraps the channel into a Output.t.

  • parameter close_noerr

    if true, then closing the result uses close_out_noerr instead of close_out to close oc

val of_buffer : Stdlib.Buffer.t -> t

of_buffer buf is an output channel that writes directly into buf. flush and close have no effect.

val output_char : t -> char -> unit

Output the buffer slice into this channel

val output : t -> bytes -> int -> int -> unit

Output the buffer slice into this channel

val output_string : t -> string -> unit
val close : t -> unit

Close the channel.

val flush : t -> unit

Flush (ie. force write) any buffered bytes.

val output_buf : t -> Buf.t -> unit
val chunk_encoding : ?buf:Buf.t -> close_rec:bool -> t -> t

chunk_encoding oc makes a new channel that outputs its content into oc in chunk encoding form.

  • parameter close_rec

    if true, closing the result will also close oc

  • parameter buf

    a buffer used to accumulate data into chunks. Chunks are emitted when buf's size gets over a certain threshold, or when flush is called.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_io/TCP_server/index.html b/dev/tiny_httpd/Tiny_httpd_io/TCP_server/index.html deleted file mode 100644 index ac7f6922..00000000 --- a/dev/tiny_httpd/Tiny_httpd_io/TCP_server/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -TCP_server (tiny_httpd.Tiny_httpd_io.TCP_server)

Module Tiny_httpd_io.TCP_server

A TCP server abstraction.

type conn_handler = {
  1. handle : client_addr:Unix.sockaddr -> Input.t -> Output.t -> unit;
    (*

    Handle client connection

    *)
}
type t = {
  1. endpoint : unit -> string * int;
    (*

    Endpoint we listen on. This can only be called from within serve.

    *)
  2. active_connections : unit -> int;
    (*

    Number of connections currently active

    *)
  3. running : unit -> bool;
    (*

    Is the server currently running?

    *)
  4. stop : unit -> unit;
    (*

    Ask the server to stop. This might not take effect immediately, and is idempotent. After this server.running() must return false.

    *)
}

A running TCP server.

This contains some functions that provide information about the running server, including whether it's active (as opposed to stopped), a function to stop it, and statistics about the number of connections.

type builder = {
  1. serve : after_init:(t -> unit) -> handle:conn_handler -> unit -> unit;
    (*

    Blocking call to listen for incoming connections and handle them. Uses the connection handler handle to handle individual client connections in individual threads/fibers/tasks.

    • parameter after_init

      is called once with the server after the server has started.

    *)
}

A TCP server builder implementation.

Calling builder.serve ~after_init ~handle () starts a new TCP server on an unspecified endpoint (most likely coming from the function returning this builder) and returns the running server.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_io/Writer/index.html b/dev/tiny_httpd/Tiny_httpd_io/Writer/index.html deleted file mode 100644 index d0e9b2da..00000000 --- a/dev/tiny_httpd/Tiny_httpd_io/Writer/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Writer (tiny_httpd.Tiny_httpd_io.Writer)

Module Tiny_httpd_io.Writer

A writer abstraction.

type t = {
  1. write : Output.t -> unit;
}

Writer.

A writer is a push-based stream of bytes. Give it an output channel and it will write the bytes in it.

This is useful for responses: an http endpoint can return a writer as its response's body, and output into it as if it were a regular out_channel, including controlling calls to flush.

  • since NEXT_RELEASE
val make : write:(Output.t -> unit) -> unit -> t
val write : Output.t -> t -> unit

Write into the channel.

val empty : t

Empty writer, will output 0 bytes.

val of_string : string -> t

A writer that just emits the bytes from the given string.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_server/index.html b/dev/tiny_httpd/Tiny_httpd_server/index.html index 70599ed3..c04f48e6 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/index.html @@ -26,7 +26,7 @@ stage:[ `Encoding | `Stage of int ] -> t -> Middleware.t -> - unit

Add a middleware to every request/response pair.

  • parameter stage

    specify when middleware applies. Encoding comes first (outermost layer), then stages in increasing order.

  • raises Invalid_argument

    if stage is `Stage n where n < 1

  • since 0.11

Request handlers

val set_top_handler : t -> (string Request.t -> Response.t) -> unit

Setup a handler called by default.

This handler is called with any request not accepted by any handler installed via add_path_handler. If no top handler is installed, unhandled paths will return a 404 not found.

val add_route_handler : + unit

Add a middleware to every request/response pair.

  • parameter stage

    specify when middleware applies. Encoding comes first (outermost layer), then stages in increasing order.

  • raises Invalid_argument

    if stage is `Stage n where n < 1

  • since 0.11

Request handlers

val set_top_handler : t -> (byte_stream Request.t -> Response.t) -> unit

Setup a handler called by default.

This handler is called with any request not accepted by any handler installed via add_path_handler. If no top handler is installed, unhandled paths will return a 404 not found.

val add_route_handler : ?accept:(unit Request.t -> (unit, Response_code.t * string) Stdlib.result) -> ?middlewares:Middleware.t list -> ?meth:Meth.t ->