Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819
  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Caching do
  5. @callback get!(Cachex.cache(), any()) :: any()
  6. @callback get(Cachex.cache(), any()) :: {atom(), any()}
  7. @callback put(Cachex.cache(), any(), any(), Keyword.t()) :: {Cachex.status(), boolean()}
  8. @callback put(Cachex.cache(), any(), any()) :: {Cachex.status(), boolean()}
  9. @callback fetch!(Cachex.cache(), any(), function() | nil) :: any()
  10. # @callback del(Cachex.cache(), any(), Keyword.t()) :: {Cachex.status(), boolean()}
  11. @callback del(Cachex.cache(), any()) :: {Cachex.status(), boolean()}
  12. @callback stream!(Cachex.cache(), any()) :: Enumerable.t()
  13. @callback expire_at(Cachex.cache(), binary(), number()) :: {Cachex.status(), boolean()}
  14. @callback exists?(Cachex.cache(), any()) :: {Cachex.status(), boolean()}
  15. @callback execute!(Cachex.cache(), function()) :: any()
  16. @callback get_and_update(Cachex.cache(), any(), function()) ::
  17. {:commit | :ignore, any()}
  18. end