# `Exgit.Object`
[🔗](https://github.com/ivarvong/exgit/blob/v0.1.0/lib/exgit/object.ex#L1)

Umbrella type + dispatch for git's four object kinds: `Blob`,
`Tree`, `Commit`, `Tag`. Each has its own struct in
`Exgit.Object.*`; this module is the common entry point for
decode/encode/sha/type across all of them.

Decoding (`decode/2`) is tagged: pass the type atom plus raw
object bytes, receive back `{:ok, struct}` or `{:error, _}`.
Decoders never raise on untrusted input — see
`Exgit.Security.DecoderFuzzTest` for the regression corpus.

# `object_type`

```elixir
@type object_type() :: :blob | :tree | :commit | :tag
```

# `sha`

```elixir
@type sha() :: &lt;&lt;_::160&gt;&gt;
```

# `t`

```elixir
@type t() ::
  Exgit.Object.Blob.t()
  | Exgit.Object.Tree.t()
  | Exgit.Object.Commit.t()
  | Exgit.Object.Tag.t()
```

# `decode`

```elixir
@spec decode(object_type(), binary()) :: {:ok, t()} | {:error, term()}
```

# `encode`

```elixir
@spec encode(t()) :: iodata()
```

# `sha`

```elixir
@spec sha(t()) :: sha()
```

# `type`

```elixir
@spec type(t()) :: object_type()
```

# `type_string`

```elixir
@spec type_string(t()) :: String.t()
```

---

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