dove

Types

pub opaque type Connection(a)
pub type RequestOption(a) {
  JSONDecoder(
    fn(dynamic.Dynamic) -> Result(a, List(dynamic.DecodeError)),
  )
}

Constructors

  • JSONDecoder(
      fn(dynamic.Dynamic) -> Result(a, List(dynamic.DecodeError)),
    )

Functions

pub fn connect(
  host: String,
  port: Int,
  timeout: Int,
) -> Result(Connection(a), Error)
pub fn get_response(
  conn: Connection(a),
  ref: Reference,
) -> #(Connection(a), Result(Response(Option(Body(a))), Error))
pub fn receive(
  conn: Connection(a),
  timeout: Int,
) -> Connection(a)
pub fn request(
  conn: Connection(a),
  request: Request(Option(Body)),
  options: List(RequestOption(a)),
) -> Result(#(Connection(a), Reference), Error)
pub fn shutdown(
  conn: Connection(a),
) -> Result(
  List(#(Reference, Result(Response(Option(Body(a))), Error))),
  Error,
)
Search Document