File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ func DecodeInto(b []byte, v interface{}) error {
108
108
return unmarshaller .Unmarshal (b , v )
109
109
}
110
110
111
+ // DecodeReader reads from the given reader and decodes a serialized IPLD cbor object into the given object.
111
112
func DecodeReader (r io.Reader , v interface {}) error {
112
113
return unmarshaller .Decode (r , v )
113
114
}
@@ -400,6 +401,11 @@ func DumpObject(obj interface{}) (out []byte, err error) {
400
401
return marshaller .Marshal (obj )
401
402
}
402
403
404
+ // EncodeWriter marshals into the writer any object as its CBOR serialized byte representation.
405
+ func EncodeWriter (obj interface {}, w io.Writer ) error {
406
+ return marshaller .Encode (obj , w )
407
+ }
408
+
403
409
func toSaneMap (n map [interface {}]interface {}) (interface {}, error ) {
404
410
if lnk , ok := n ["/" ]; ok && len (n ) == 1 {
405
411
lnkb , ok := lnk .([]byte )
You can’t perform that action at this time.
0 commit comments