We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
That is, something like:
type Node interface { Unmarshal(v interface{}) error // ... } type BlockEncoderFunc func(prefix cid.Prefix, o interface{}) (Node, error) type BlockEncoder map[uint64]BlockEncoderFunc // ... func Encode(o interface{}, prefix cid.Prefix) (Node, error) { if node, ok := node.(Node); ok && node.Cid().Prefix() == prefix { return node, nil } return DefaultBlockEncoder[prefix.Codec](prefix, o) } // ...
This way, we can call Encode(Decode(some_block), some_prefix) to re-encode a block in a new format.
Encode(Decode(some_block), some_prefix)
The text was updated successfully, but these errors were encountered:
Related: https://github.com/polydawn/refmt
Sorry, something went wrong.
No branches or pull requests
That is, something like:
This way, we can call
Encode(Decode(some_block), some_prefix)
to re-encode a block in a new format.The text was updated successfully, but these errors were encountered: