package dream-pure

  1. Overview
  2. Docs

Module Dream_pure.MessageSource

Sourcetype client
Sourcetype server
Sourcetype 'a message
Sourcetype request = client message
Sourcetype response = server message
Sourcetype 'a promise = 'a Lwt.t
Sourcetype handler = request -> response promise
Sourcetype middleware = handler -> handler
Sourceval request : ?method_:[< Method.method_ ] -> ?target:string -> ?headers:(string * string) list -> Stream.stream -> Stream.stream -> request
Sourceval method_ : request -> Method.method_
Sourceval target : request -> string
Sourceval set_method_ : request -> [< Method.method_ ] -> unit
Sourceval set_target : request -> string -> unit
Sourceval response : ?status:[< Status.status ] -> ?code:int -> ?headers:(string * string) list -> Stream.stream -> Stream.stream -> response
Sourceval set_status : response -> Status.status -> unit
Sourceval header : 'a message -> string -> string option
Sourceval headers : 'a message -> string -> string list
Sourceval all_headers : 'a message -> (string * string) list
Sourceval has_header : 'a message -> string -> bool
Sourceval add_header : 'a message -> string -> string -> unit
Sourceval drop_header : 'a message -> string -> unit
Sourceval set_header : 'a message -> string -> string -> unit
Sourceval set_all_headers : 'a message -> (string * string) list -> unit
Sourceval sort_headers : (string * string) list -> (string * string) list
Sourceval lowercase_headers : 'a message -> unit
Sourceval body : 'a message -> string promise
Sourceval set_body : 'a message -> string -> unit
Sourceval set_content_length_headers : 'a message -> unit
Sourceval drop_content_length_headers : 'a message -> unit
Sourceval read : Stream.stream -> string option promise
Sourceval write : Stream.stream -> string -> unit promise
Sourceval flush : Stream.stream -> unit promise
Sourceval close : Stream.stream -> unit promise
Sourceval client_stream : 'a message -> Stream.stream
Sourceval server_stream : 'a message -> Stream.stream
Sourceval set_client_stream : 'a message -> Stream.stream -> unit
Sourceval set_server_stream : 'a message -> Stream.stream -> unit
Sourceval create_websocket : response -> Stream.stream * Stream.stream
Sourceval get_websocket : response -> (Stream.stream * Stream.stream) option
Sourceval close_websocket : ?code:int -> (Stream.stream * Stream.stream) -> unit promise
Sourcetype text_or_binary = [
  1. | `Text
  2. | `Binary
]
Sourcetype end_of_message = [
  1. | `End_of_message
  2. | `Continues
]
Sourceval receive : Stream.stream -> string option promise
Sourceval receive_fragment : Stream.stream -> (string * text_or_binary * end_of_message) option promise
Sourceval send : ?text_or_binary:[< text_or_binary ] -> ?end_of_message:[< end_of_message ] -> Stream.stream -> string -> unit promise
Sourceval no_middleware : middleware
Sourceval pipeline : middleware list -> middleware
Sourcetype 'a field
Sourceval new_field : ?name:string -> ?show_value:('a -> string) -> unit -> 'a field
Sourceval field : 'b message -> 'a field -> 'a option
Sourceval set_field : 'b message -> 'a field -> 'a -> unit
Sourceval fold_fields : (string -> string -> 'a -> 'a) -> 'a -> 'b message -> 'a
OCaml

Innovation. Community. Security.