rocksky/xrpc
Raw XRPC transport and decoding helpers for the generated rocksky/api.
Types
pub type Error {
TransportError(String)
HttpError(status: Int, body: BitArray)
DecodeError(json.DecodeError)
}
Constructors
-
TransportError(String) -
HttpError(status: Int, body: BitArray) -
DecodeError(json.DecodeError)
pub type RawResponse {
RawResponse(status: Int, body: BitArray)
}
Constructors
-
RawResponse(status: Int, body: BitArray)
Values
pub fn raw(
client: Client,
method: Method,
nsid: String,
params: json.Json,
body: option.Option(json.Json),
) -> Result(RawResponse, Error)
Escape hatch. Preserves status and raw bytes, including non-2xx responses. Query arrays become repeated URL parameters. A POST body is independent of params.
pub fn request(
client: Client,
method: Method,
nsid: String,
params: json.Json,
body: option.Option(json.Json),
decoder: decode.Decoder(a),
) -> Result(a, Error)
Custom typed call: supply your own decoder for endpoints outside the generated API.
pub fn request_bytes(
client: Client,
method: Method,
nsid: String,
params: json.Json,
body: option.Option(json.Json),
) -> Result(BitArray, Error)