View Source LibWechat.Client behaviour (lib_wechat v0.1.2)

微信请求request behavior

Summary

Types

@type api() :: bitstring()
@type body() :: %{required(String.t()) => any()} | nil
@type method() :: Finch.Request.method()
@type opts() :: keyword()
@type params() :: %{required(String.t()) => any()} | nil
@type t() :: struct()

Callbacks

Link to this callback

do_request(client, method, api, body, params, opts)

View Source
@callback do_request(
  client :: t(),
  method :: method(),
  api :: api(),
  body :: body(),
  params :: params(),
  opts :: opts()
) :: {:ok, iodata()} | {:error, LibWechat.Client.Error.t()}
@callback new(opts()) :: t()
@callback start_link([{:client, t()}]) :: GenServer.on_start()

Functions

Link to this function

do_request(client, method, api, body, params, opts \\ [])

View Source
@spec do_request(
  client :: t(),
  method :: method(),
  api :: api(),
  body :: body(),
  params :: params(),
  opts :: opts()
) :: {:ok, iodata()} | {:error, LibWechat.Client.Error.t()}