View Source Plausible.Shields (Plausible v0.0.1)

Contextual interface for shields.

Summary

Functions

Link to this function

add_country_rule(site_or_id, params, opts \\ [])

View Source
@spec add_country_rule(Plausible.Site.t() | non_neg_integer(), map(), Keyword.t()) ::
  {:ok, Plausible.Shield.CountryRule.t()} | {:error, Ecto.Changeset.t()}
Link to this function

add_hostname_rule(site_or_id, params, opts \\ [])

View Source
@spec add_hostname_rule(Plausible.Site.t() | non_neg_integer(), map(), Keyword.t()) ::
  {:ok, Plausible.Shield.HostnameRule.t()} | {:error, Ecto.Changeset.t()}
Link to this function

add_ip_rule(site_or_id, params, opts \\ [])

View Source
@spec add_ip_rule(Plausible.Site.t() | non_neg_integer(), map(), Keyword.t()) ::
  {:ok, Plausible.Shield.IPRule.t()} | {:error, Ecto.Changeset.t()}
Link to this function

add_page_rule(site_or_id, params, opts \\ [])

View Source
@spec add_page_rule(Plausible.Site.t() | non_neg_integer(), map(), Keyword.t()) ::
  {:ok, Plausible.Shield.PageRule.t()} | {:error, Ecto.Changeset.t()}
Link to this function

allowed_hostname_patterns(domain)

View Source
@spec allowed_hostname_patterns(Plausible.Site.t() | String.t()) ::
  [String.t()] | :all
Link to this function

count_country_rules(site_or_id)

View Source
@spec count_country_rules(Plausible.Site.t() | non_neg_integer()) :: non_neg_integer()
Link to this function

count_hostname_rules(site_or_id)

View Source
@spec count_hostname_rules(Plausible.Site.t() | non_neg_integer()) ::
  non_neg_integer()
Link to this function

count_ip_rules(site_or_id)

View Source
@spec count_ip_rules(Plausible.Site.t() | non_neg_integer()) :: non_neg_integer()
Link to this function

count_page_rules(site_or_id)

View Source
@spec count_page_rules(Plausible.Site.t() | non_neg_integer()) :: non_neg_integer()
Link to this function

country_blocked?(domain, country_code)

View Source
@spec country_blocked?(Plausible.Site.t() | String.t(), String.t()) :: boolean()
Link to this function

hostname_allowed?(domain, hostname)

View Source
@spec hostname_allowed?(Plausible.Site.t() | String.t(), String.t()) :: boolean()
Link to this function

ip_blocked?(domain, address)

View Source
@spec ip_blocked?(Plausible.Site.t() | String.t(), String.t()) :: boolean()
Link to this function

list_country_rules(site_or_id)

View Source
@spec list_country_rules(Plausible.Site.t() | non_neg_integer()) :: [
  Plausible.Shield.CountryRule.t()
]
Link to this function

list_hostname_rules(site_or_id)

View Source
@spec list_hostname_rules(Plausible.Site.t() | non_neg_integer()) :: [
  Plausible.Shield.HostnameRule.t()
]
Link to this function

list_ip_rules(site_or_id)

View Source
@spec list_ip_rules(Plausible.Site.t() | non_neg_integer()) :: [
  Plausible.Shield.IPRule.t()
]
Link to this function

list_page_rules(site_or_id)

View Source
@spec list_page_rules(Plausible.Site.t() | non_neg_integer()) :: [
  Plausible.Shield.PageRule.t()
]
Link to this function

maximum_hostname_rules()

View Source
Link to this function

page_blocked?(domain, address)

View Source
@spec page_blocked?(Plausible.Site.t() | String.t(), String.t()) :: boolean()
Link to this function

remove_country_rule(site_or_id, rule_id)

View Source
@spec remove_country_rule(Plausible.Site.t() | non_neg_integer(), String.t()) :: :ok
Link to this function

remove_hostname_rule(site_or_id, rule_id)

View Source
@spec remove_hostname_rule(Plausible.Site.t() | non_neg_integer(), String.t()) :: :ok
Link to this function

remove_ip_rule(site_or_id, rule_id)

View Source
@spec remove_ip_rule(Plausible.Site.t() | non_neg_integer(), String.t()) :: :ok
Link to this function

remove_page_rule(site_or_id, rule_id)

View Source
@spec remove_page_rule(Plausible.Site.t() | non_neg_integer(), String.t()) :: :ok