IpAccessControl.Options (IP Access Control Plug v1.1.0)

View Source

Manage IpAccessControl options

Summary

Functions

The default value for the given option.

Pre-processes keyword options. Where possible, function resolution will be delayed until unpack/1 is called.

Evaluate preprocessed options.

Types

config()

@type config() :: %{
  allow: (-> [binary(), ...]) | [binary(), ...],
  on_blocked: (Plug.Conn.t(), Plug.opts() -> Plug.Conn.t()),
  response_code_on_blocked: integer(),
  response_body_on_blocked: String.t()
}

input_config()

@type input_config() :: [
  module: module(),
  allow: (-> [binary(), ...]) | [binary(), ...],
  on_blocked: (Plug.Conn.t(), Plug.opts() -> Plug.Conn.t()) | module(),
  response_code_on_blocked: integer(),
  response_body_on_blocked: String.t()
]

Functions

default(option)

@spec default(:on_blocked | :response_code_on_blocked | :response_body_on_blocked) ::
  {IpAccessControl, :ip_access_on_blocked} | 401 | String.t()

The default value for the given option.

pack(options)

@spec pack(input_config()) :: config()

Pre-processes keyword options. Where possible, function resolution will be delayed until unpack/1 is called.

unpack(options)

@spec unpack(config()) :: config()

Evaluate preprocessed options.