diff --git a/writefile.go b/writefile.go index 6c9a63b601b3f45444136f63fac90c64b771ba83..1b369dd4b5a05c3c7b782f182b0c344da9512f50 100644 --- a/writefile.go +++ b/writefile.go @@ -8,6 +8,11 @@ import ( "golang.org/x/xerrors" ) +// WriteTupleFileEncodersToFile generates array backed MarshalCBOR and UnmarshalCBOR implementations for the +// given types in the specified file, with the specified package name. +// +// The MarshalCBOR and UnmarshalCBOR implementations will marshal/unmarshal each type's fields as a +// fixed-length CBOR array of field values. func WriteTupleEncodersToFile(fname, pkg string, types ...interface{}) error { buf := new(bytes.Buffer) @@ -50,6 +55,11 @@ func WriteTupleEncodersToFile(fname, pkg string, types ...interface{}) error { return nil } +// WriteMapFileEncodersToFile generates map backed MarshalCBOR and UnmarshalCBOR implementations for +// the given types in the specified file, with the specified package name. +// +// The MarshalCBOR and UnmarshalCBOR implementations will marshal/unmarshal each type's fields as a +// map of field names to field values. func WriteMapEncodersToFile(fname, pkg string, types ...interface{}) error { buf := new(bytes.Buffer)