# `Astral.Image.Remote.Pattern`
[🔗](https://github.com/elixir-volt/astral/blob/v0.7.0/lib/astral/image/remote/pattern.ex#L1)

A remote image allowlist pattern.

Patterns are declared with URL-shaped strings such as
`https://images.example.com/**` or `https://**.amazonaws.com/bucket/**`.
Hostname wildcards follow Astro's semantics:

  * `*.example.com` matches one subdomain level.
  * `**.example.com` matches any subdomain depth.

Pathname wildcards also follow Astro's semantics:

  * `/assets/*` matches exactly one nested segment.
  * `/assets/**` matches any nested path below `/assets/`.

# `t`

```elixir
@type t() :: %Astral.Image.Remote.Pattern{
  hostname: String.t() | nil,
  pathname: String.t() | nil,
  port: String.t() | nil,
  protocol: String.t() | nil
}
```

# `match?`

```elixir
@spec match?(t(), URI.t()) :: boolean()
```

Return true when the URL matches the pattern.

# `parse`

```elixir
@spec parse(String.t()) :: {:ok, t()} | {:error, term()}
```

Parse a URL-shaped remote allowlist pattern.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
