dove
Types
pub opaque type Connection(a)
pub type RequestBody {
JSON(String)
PlainText(String)
}
Constructors
-
JSON(String)
-
PlainText(String)
pub type RequestOption(a) {
JSONDecoder(
fn(dynamic.Dynamic) -> Result(a, List(dynamic.DecodeError)),
)
}
Constructors
-
JSONDecoder( fn(dynamic.Dynamic) -> Result(a, List(dynamic.DecodeError)), )
pub type ResponseBody(a) {
Empty
Raw(String)
JSONDecoded(a)
InvalidOrUnexpectedJSON(String, json.DecodeError)
}
Constructors
-
Empty
-
Raw(String)
-
JSONDecoded(a)
-
InvalidOrUnexpectedJSON(String, json.DecodeError)
Functions
pub fn connect(
host: String,
port: Int,
timeout: Int,
) -> Result(Connection(a), Error)
pub fn get_response(
conn: Connection(a),
ref: Reference,
) -> Result(Response(ResponseBody(a)), Error)