logo

pleroma

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

caching.ex (1288B)


  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.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 fetch(Cachex.cache(), any(), function() | nil) ::
  11. {atom(), any()} | {atom(), any(), any()}
  12. # @callback del(Cachex.cache(), any(), Keyword.t()) :: {Cachex.status(), boolean()}
  13. @callback del(Cachex.cache(), any()) :: {Cachex.status(), boolean()}
  14. @callback stream!(Cachex.cache(), any()) :: Enumerable.t()
  15. @callback expire_at(Cachex.cache(), binary(), number()) :: {Cachex.status(), boolean()}
  16. @callback expire(Cachex.cache(), binary(), number()) :: {Cachex.status(), boolean()}
  17. @callback exists?(Cachex.cache(), any()) :: {Cachex.status(), boolean()}
  18. @callback execute!(Cachex.cache(), function()) :: any()
  19. @callback get_and_update(Cachex.cache(), any(), function()) ::
  20. {:commit | :ignore, any()}
  21. end