Struct representing a single feature flag.
Fields
:name— Atom identifier (e.g.:new_dashboard):enabled— Whether the flag is on. For rollout flags this is the master switch; individual users are gated by the rollout percentage.:default— Fallback value when the flag is queried but not defined. Most flags usedefault: false; if you want safe-by-default for risky features, usedefault: false.:description— Optional human-readable explanation:rollout—0..100percentage of users that get the feature whenenabled: true.nilmeans binary on/off (no gradual rollout).:created_at— When the flag was first defined:updated_at— Last modification timestamp
Summary
Functions
Creates a new Flag with the given attributes. Fills timestamps automatically.
Types
@type t() :: %Botica.Flags.Flag{ created_at: DateTime.t(), default: boolean(), description: String.t() | nil, enabled: boolean(), name: atom(), rollout: non_neg_integer() | nil, updated_at: DateTime.t() }
Functions
Creates a new Flag with the given attributes. Fills timestamps automatically.
Examples
iex> Botica.Flags.Flag.new(:beta, default: false)
%Botica.Flags.Flag{name: :beta, enabled: false, default: false, ...}
iex> Botica.Flags.Flag.new(:rate_limiting, default: false, rollout: 25)
%Botica.Flags.Flag{name: :rate_limiting, rollout: 25, ...}