ProtoRune.XRPC.Query (proto_rune v0.1.1)

The XRPC.Query module is responsible for defining and managing queries in the XRPC system. It encapsulates the method, parameters, headers, and an optional parser, providing functions to create and manipulate query structures.

Overview

This module allows for:

  • Creating Queries: Use new/1 or new/2 to create a query with an optional parser.
  • Adding Parameters and Headers: Use put_param/3 and put_header/3 to add query parameters and headers.
  • String Representation: Converts a query to a string URL, including parameters if present.

Functions

new/1

Creates a new query with the given method.

XRPC.Query.new("app.bsky.actor.getProfile")

new/2

Creates a new query with a method and a parser for validation.

XRPC.Query.new("app.bsky.feed.getFeed", from: MyParser)

put_param/3

Adds or updates a query parameter.

query = XRPC.Query.put_param(query, :actor_id, "123")

put_header/3

Adds or updates a request header.

query = XRPC.Query.put_header(query, "Authorization", "Bearer token")

Summary

Functions

Link to this function

add_params(query, params)

Link to this function

new(method, list)

Link to this function

put_header(query, key, value)

Link to this function

put_param(query, key, value)