logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

api.ex (899B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Gun.API do
  5. @behaviour Pleroma.Gun
  6. alias Pleroma.Gun
  7. @gun_keys [
  8. :connect_timeout,
  9. :http_opts,
  10. :http2_opts,
  11. :protocols,
  12. :retry,
  13. :retry_timeout,
  14. :trace,
  15. :transport,
  16. :tls_opts,
  17. :tcp_opts,
  18. :socks_opts,
  19. :ws_opts,
  20. :supervise
  21. ]
  22. @impl Gun
  23. def open(host, port, opts \\ %{}), do: :gun.open(host, port, Map.take(opts, @gun_keys))
  24. @impl Gun
  25. defdelegate info(pid), to: :gun
  26. @impl Gun
  27. defdelegate close(pid), to: :gun
  28. @impl Gun
  29. defdelegate await_up(pid, timeout \\ 5_000), to: :gun
  30. @impl Gun
  31. defdelegate connect(pid, opts), to: :gun
  32. @impl Gun
  33. defdelegate await(pid, ref), to: :gun
  34. @impl Gun
  35. defdelegate set_owner(pid, owner), to: :gun
  36. end