View Source Permify.Client (Permify v0.1.0)

Provides some helpers to call the service via HTTP.

Link to this section Summary

Functions

Defines a helper to make HTTP GET request.

Defines a helper to make HTTP POST request.

Defines a helper to upload the Permify schema.

Link to this section Types

@type error() :: {:error, binary()} | {:error, pos_integer()}
@opaque http_client()
@type success() :: :ok | {:ok, any()}
@type t() :: %Permify.Client{http_client: http_client()}

Link to this section Functions

Link to this function

generate_upload_body(schema)

View Source
@spec generate_upload_body(binary()) :: binary()
@spec get(t(), binary()) :: success() | error()

Defines a helper to make HTTP GET request.

Link to this function

new(endpoint \\ "http://localhost:3476/v1")

View Source
@spec new(binary() | URI.t()) :: t()

Creates a new struct Permify.Client.

Link to this function

parse_response(response)

View Source
@spec parse_response(Req.Response.t()) :: success() | error()
Link to this function

post(client, path, body)

View Source
@spec post(t(), binary(), any()) :: success() | error()

Defines a helper to make HTTP POST request.

Link to this function

upload_schema(client, path, schema)

View Source
@spec upload_schema(t(), binary(), binary()) :: success() | error()

Defines a helper to upload the Permify schema.