pleroma/lib/pleroma/config/getting.ex

16 lines
444 B
Elixir
Raw Normal View History

2020-12-16 20:41:35 +01:00
# Pleroma: A lightweight social networking server
2022-02-26 07:11:42 +01:00
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
2020-12-16 20:41:35 +01:00
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Config.Getting do
@callback get(any()) :: any()
@callback get(any(), any()) :: any()
def get(key), do: get(key, nil)
def get(key, default), do: impl().get(key, default)
2023-11-12 14:13:27 +01:00
def impl do
Application.get_env(:pleroma, :config_impl, Pleroma.Config)
end
2020-12-16 20:41:35 +01:00
end