github.com/storacha/go-ucanto@v0.7.2/core/ipld/codec/codec.go (about) 1 package codec 2 3 import ( 4 "github.com/ipld/go-ipld-prime/node/bindnode" 5 "github.com/ipld/go-ipld-prime/schema" 6 ) 7 8 type Encoder interface { 9 Code() uint64 10 Encode(value any, typ schema.Type, opts ...bindnode.Option) ([]byte, error) 11 } 12 13 type Decoder interface { 14 Code() uint64 15 Decode(bytes []byte, bind any, typ schema.Type, opts ...bindnode.Option) error 16 }