# `Stevedore.Transport.Parse`
[🔗](https://github.com/oshlabs/stevedore/blob/v0.2.0/lib/stevedore/transport/parse.ex#L1)

Parses Skopeo-style transport-prefixed references into a `{transport, ref}` pair.

Recognized prefixes (see `t:Stevedore.Transport.t/0` implementations):

  * `docker://name:tag` / `docker://name@digest` — a remote registry
  * `oci:path[:tag]` — an OCI image-layout directory
  * `oci-archive:path[:tag]` — an OCI image layout as a tar
  * `docker-archive:path[:tag]` — a `docker save` tarball
  * `dir:path` — a flat directory of manifest + blobs
  * `static:path[:tag]` — a Stevedore registry-v2 directory tree

`ref` is the tag/digest portion (or `nil` for transports that hold a single image). `opts` is
carried onto the transport (e.g. registry `:creds`).

Spec: [containers-transports(5)](https://github.com/containers/image/blob/main/docs/containers-transports.5.md).

# `parse`

```elixir
@spec parse(
  String.t(),
  keyword()
) ::
  {:ok, {Stevedore.Transport.t(), Stevedore.Transport.ref()}}
  | {:error, {:bad_input, term()}}
```

Parses a transport-prefixed reference string.

## Examples

    iex> {:ok, {%Stevedore.Transport.OCILayout{path: "./out"}, "3.20"}} =
    ...>   Stevedore.Transport.Parse.parse("oci:./out:3.20")
    iex> :ok
    :ok

---

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