Configuration client struct for interacting with Meilisearch.
Summary
Functions
Builds a new Meili.Client.
Performs an HTTP request using the client's Req.Request instance.
Same as request/4 but raises a Meili.Error on failure.
Types
@type t() :: %Meili.Client{ key: String.t() | nil, req: Req.Request.t(), url: String.t() }
Functions
Builds a new Meili.Client.
Options
:urlor:endpoint- The Meilisearch base URL (default:http://localhost:7700).:keyor:api_key- The API key or master key for authentication.:req_options- Custom configuration options passed directly toReq.new/1.
Examples
client = Meili.Client.new(url: "http://localhost:7700", key: "secret-key")
@spec request(t(), atom() | String.t(), String.t(), Keyword.t()) :: {:ok, term()} | {:error, Meili.Error.t()}
Performs an HTTP request using the client's Req.Request instance.
Examples
{:ok, body} = Meili.Client.request(client, :get, "/health")
Same as request/4 but raises a Meili.Error on failure.
Examples
body = Meili.Client.request!(client, :get, "/health")