2019-07-09 23:13:23 -06:00
|
|
|
# Pleroma: A lightweight social networking server
|
2021-01-12 23:49:20 -07:00
|
|
|
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
2019-07-09 23:13:23 -06:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-07-09 10:54:13 -06:00
|
|
|
defmodule Pleroma.ReverseProxy.Client do
|
2020-02-11 00:12:57 -07:00
|
|
|
@type status :: pos_integer()
|
|
|
|
@type header_name :: String.t()
|
|
|
|
@type header_value :: String.t()
|
|
|
|
@type headers :: [{header_name(), header_value()}]
|
|
|
|
|
|
|
|
@callback request(atom(), String.t(), headers(), String.t(), list()) ::
|
|
|
|
{:ok, status(), headers(), reference() | map()}
|
|
|
|
| {:ok, status(), headers()}
|
2019-07-09 10:54:13 -06:00
|
|
|
| {:ok, reference()}
|
|
|
|
| {:error, term()}
|
|
|
|
|
2020-02-11 00:12:57 -07:00
|
|
|
@callback stream_body(map()) :: {:ok, binary(), map()} | :done | {:error, atom() | String.t()}
|
2019-07-09 10:54:13 -06:00
|
|
|
|
|
|
|
@callback close(reference() | pid() | map()) :: :ok
|
|
|
|
end
|