View Source Plausible.Shields (Plausible v0.0.1)
Contextual interface for shields.
Summary
Functions
@spec add_country_rule(Plausible.Site.t() | non_neg_integer(), map(), Keyword.t()) :: {:ok, Plausible.Shield.CountryRule.t()} | {:error, Ecto.Changeset.t()}
@spec add_hostname_rule(Plausible.Site.t() | non_neg_integer(), map(), Keyword.t()) :: {:ok, Plausible.Shield.HostnameRule.t()} | {:error, Ecto.Changeset.t()}
@spec add_ip_rule(Plausible.Site.t() | non_neg_integer(), map(), Keyword.t()) :: {:ok, Plausible.Shield.IPRule.t()} | {:error, Ecto.Changeset.t()}
@spec add_page_rule(Plausible.Site.t() | non_neg_integer(), map(), Keyword.t()) :: {:ok, Plausible.Shield.PageRule.t()} | {:error, Ecto.Changeset.t()}
@spec allowed_hostname_patterns(Plausible.Site.t() | String.t()) :: [String.t()] | :all
@spec count_country_rules(Plausible.Site.t() | non_neg_integer()) :: non_neg_integer()
@spec count_hostname_rules(Plausible.Site.t() | non_neg_integer()) :: non_neg_integer()
@spec count_ip_rules(Plausible.Site.t() | non_neg_integer()) :: non_neg_integer()
@spec count_page_rules(Plausible.Site.t() | non_neg_integer()) :: non_neg_integer()
@spec country_blocked?(Plausible.Site.t() | String.t(), String.t()) :: boolean()
@spec hostname_allowed?(Plausible.Site.t() | String.t(), String.t()) :: boolean()
@spec ip_blocked?(Plausible.Site.t() | String.t(), String.t()) :: boolean()
@spec list_country_rules(Plausible.Site.t() | non_neg_integer()) :: [ Plausible.Shield.CountryRule.t() ]
@spec list_hostname_rules(Plausible.Site.t() | non_neg_integer()) :: [ Plausible.Shield.HostnameRule.t() ]
@spec list_ip_rules(Plausible.Site.t() | non_neg_integer()) :: [ Plausible.Shield.IPRule.t() ]
@spec list_page_rules(Plausible.Site.t() | non_neg_integer()) :: [ Plausible.Shield.PageRule.t() ]
@spec page_blocked?(Plausible.Site.t() | String.t(), String.t()) :: boolean()
@spec remove_country_rule(Plausible.Site.t() | non_neg_integer(), String.t()) :: :ok
@spec remove_hostname_rule(Plausible.Site.t() | non_neg_integer(), String.t()) :: :ok
@spec remove_ip_rule(Plausible.Site.t() | non_neg_integer(), String.t()) :: :ok
@spec remove_page_rule(Plausible.Site.t() | non_neg_integer(), String.t()) :: :ok