Commit 27e0a6a4 authored by Daniel Martí's avatar Daniel Martí

re-add the Encoder and Decoder APIs

We're a semver v1, so we can't remove exposed APIs unless we bump to
v2+. Bumping the major version to just rename two APIs seems a bit
overkill; keeping the old ones around and deprecating them is much
easier.

This partially reverts commit b8473079.
parent b641b0ff
Pipeline #867 failed with stages
in 0 seconds
......@@ -50,3 +50,18 @@ func AddSupportToChooser(existing traversal.LinkTargetNodePrototypeChooser) trav
return existing(lnk, lnkCtx)
}
}
// We switched to simpler API names after v1.0.0, so keep the old names around
// as deprecated forwarding funcs until a future v2+.
// TODO: consider deprecating Marshal/Unmarshal too, since it's a bit
// unnecessary to have two supported names for each API.
// Deprecated: use Decode instead.
func Decoder(na ipld.NodeAssembler, r io.Reader) error {
return Unmarshal(na, r)
}
// Deprecated: use Encode instead.
func Encoder(n ipld.Node, w io.Writer) error {
return Marshal(n, w)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment