We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa1d4d4 commit 8963db2Copy full SHA for 8963db2
lib/fun_with_flags/entry_point.ex
@@ -0,0 +1,31 @@
1
+defmodule FunWithFlags.EntryPoint do
2
+ @moduledoc """
3
+ Defines an entry point to query feature flags.
4
+
5
+ ## Example
6
7
+ defmodule MyApp.Flags do
8
+ use FunWithFlags.EntryPoint
9
+ end
10
11
+ MyApp.Flags.enabled?(:foo)
12
13
+ """
14
15
+ @doc false
16
+ defmacro __using__(opts) do
17
+ quote bind_quoted: [opts: opts] do
18
+ @behaviour FunWithFlags.EntryPoint
19
20
+ # TODO: add what's currently in the top module.
21
22
23
24
+ @doc """
25
+ An entry point must define this callback to provide its configuration.
26
27
+ This function is supposed to retrieve any runtime config (e.g. ENV vars) and
28
+ return it as a keyword list.
29
30
+ @callback config() :: {:ok, Keyword.t()}
31
+end
0 commit comments