Merge branch 'admin-fix-duplicated-endpoints' into 'develop'
[akkoma] / lib / pleroma / caching.ex
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
5 defmodule Pleroma.Caching do
6 @callback get!(Cachex.cache(), any()) :: any()
7 @callback get(Cachex.cache(), any()) :: {atom(), any()}
8 @callback put(Cachex.cache(), any(), any(), Keyword.t()) :: {Cachex.status(), boolean()}
9 @callback put(Cachex.cache(), any(), any()) :: {Cachex.status(), boolean()}
10 @callback fetch!(Cachex.cache(), any(), function() | nil) :: any()
11 # @callback del(Cachex.cache(), any(), Keyword.t()) :: {Cachex.status(), boolean()}
12 @callback del(Cachex.cache(), any()) :: {Cachex.status(), boolean()}
13 @callback stream!(Cachex.cache(), any()) :: Enumerable.t()
14 @callback expire_at(Cachex.cache(), binary(), number()) :: {Cachex.status(), boolean()}
15 @callback exists?(Cachex.cache(), any()) :: {Cachex.status(), boolean()}
16 @callback execute!(Cachex.cache(), function()) :: any()
17 @callback get_and_update(Cachex.cache(), any(), function()) ::
18 {:commit | :ignore, any()}
19 end