package resp-server

  1. Overview
  2. Docs

Construct a new SERVER with given authentication mode and backend

Parameters

module A : AUTH
module D : BACKEND

Signature

module Auth = A

Authentication mode

module Backend = D

Backend mode

val ok : Hiredis.value option Lwt.t

Respond with OK simple string

val error : string -> Hiredis.value option Lwt.t

Respond with an error

val invalid_arguments : unit -> Hiredis.value option Lwt.t

Response with an invalid arguments error

type t

Underlying server type, this is typically not available to * consumers of the API

type command = Backend.t -> Backend.client -> string -> Hiredis.value array -> Hiredis.value option Lwt.t

The signature of a command function

val create : ?auth:Auth.t -> ?default:command -> ?commands:(string * command) list -> ?host:string -> ?tls_config:Conduit_lwt_unix.tls_server_key -> Conduit_lwt_unix.server -> Backend.t -> t Lwt.t

Create a new server instance. * * - auth sets the authentication * - default sets the default command handler * - commands sets the commands for the server * - host is the hostname of the server (ex 127.0.0.1) * - tls_config configures ssl for the server - see conduit-lwt-unix for more inforation * - The server type is also inherited from Conduit, but typically you will use either * `TCP (`PORT $PORTNUMBER) or `Unix_domain_socket (`File $FILENAME)

val run : ?backlog:int -> ?timeout:int -> ?stop:unit Lwt.t -> ?on_exn:(exn -> unit) -> t -> unit Lwt.t

Run the server

OCaml

Innovation. Community. Security.