Versions in this module Expand all Collapse all v0 v0.1.1 Apr 20, 2024 v0.1.0 Feb 7, 2024 Changes in this version + const ByteArrayMaxLen + const FieldNameSelf + const MajArray + const MajByteString + const MajMap + const MajNegativeInt + const MajOther + const MajTag + const MajTextString + const MajUnsignedInt + const MaxLenTag + const MaxLength + const NoUsrMaxLen + var CborBoolFalse = []byte + var CborBoolTrue = []byte + var CborNull = []byte + func CborEncodeMajorType(t byte, l uint64) []byte + func CborReadHeader(br io.Reader) (byte, uint64, error) + func CborReadHeaderBuf(br io.Reader, scratch []byte) (byte, uint64, error) + func CborWriteHeader(w io.Writer, t byte, l uint64) error + func EncodeBool(b bool) []byte + func GenMapEncodersForType(gti *GenTypeInfo, w io.Writer) error + func GenTupleEncodersForType(gti *GenTypeInfo, w io.Writer) error + func MakeByteString(h []byte) string + func PrintHeaderAndUtilityMethods(w io.Writer, pkg string, typeInfos []*GenTypeInfo) error + func ReadByteArray(br io.Reader, maxlen uint64) ([]byte, error) + func ReadCid(br io.Reader) (cid.Cid, error) + func ReadString(r io.Reader) (string, error) + func ReadStringBuf(r io.Reader, _ []byte) (string, error) + func ReadStringWithMax(r io.Reader, maxLength uint64) (string, error) + func ReadTaggedByteArray(br io.Reader, exptag uint64, maxlen uint64) (bs []byte, err error) + func ScanForLinks(br io.Reader, cb func(cid.Cid)) (err error) + func ValidateCBOR(b []byte) error + func WriteBool(w io.Writer, b bool) error + func WriteByteArray(bw io.Writer, bytes []byte) error + func WriteCid(w io.Writer, c cid.Cid) error + func WriteCidBuf(buf []byte, w io.Writer, c cid.Cid) error + func WriteMajorTypeHeader(w io.Writer, t byte, l uint64) error + func WriteMajorTypeHeaderBuf(buf []byte, w io.Writer, t byte, l uint64) error + func WriteMapEncodersToFile(fname, pkg string, types ...interface{}) error + func WriteTupleEncodersToFile(fname, pkg string, types ...interface{}) error + type BytePeeker interface + func GetPeeker(r io.Reader) BytePeeker + type CBORMarshaler interface + MarshalCBOR func(io.Writer) error + type CBORUnmarshaler interface + UnmarshalCBOR func(io.Reader) error + type CborBool bool + func (cb *CborBool) UnmarshalCBOR(r io.Reader) error + func (cb CborBool) MarshalCBOR(w io.Writer) error + type CborCid cid.Cid + func (c *CborCid) UnmarshalCBOR(r io.Reader) error + func (c CborCid) MarshalCBOR(w io.Writer) error + type CborInt int64 + func (ci *CborInt) UnmarshalCBOR(r io.Reader) error + func (ci CborInt) MarshalCBOR(w io.Writer) error + type CborReader struct + func NewCborReader(r io.Reader) *CborReader + func (cr *CborReader) Read(p []byte) (n int, err error) + func (cr *CborReader) ReadByte() (byte, error) + func (cr *CborReader) ReadHeader() (byte, uint64, error) + func (cr *CborReader) SetReader(r io.Reader) + func (cr *CborReader) UnreadByte() error + type CborTime time.Time + func (ct *CborTime) UnmarshalCBOR(r io.Reader) error + func (ct *CborTime) UnmarshalJSON(b []byte) error + func (ct CborTime) MarshalCBOR(w io.Writer) error + func (ct CborTime) MarshalJSON() ([]byte, error) + func (ct CborTime) Time() time.Time + type CborWriter struct + func NewCborWriter(w io.Writer) *CborWriter + func (cw *CborWriter) CborWriteHeader(t byte, l uint64) error + func (cw *CborWriter) SetWriter(w io.Writer) + func (cw *CborWriter) Write(p []byte) (n int, err error) + func (cw *CborWriter) WriteMajorTypeHeader(t byte, l uint64) error + func (cw *CborWriter) WriteString(s string) (int, error) + type Deferred struct + Raw []byte + func (d *Deferred) MarshalCBOR(w io.Writer) error + func (d *Deferred) UnmarshalCBOR(br io.Reader) (err error) + type Field struct + Const *string + IterLabel string + MapKey string + MaxLen int + Name string + OmitEmpty bool + Pkg string + Pointer bool + PreserveNil bool + Type reflect.Type + func (f Field) ElemName() string + func (f Field) EmptyVal() (string, error) + func (f Field) IsArray() bool + func (f Field) Len() int + func (f Field) TypeName() string + type Gen struct + MaxArrayLength int + MaxByteLength int + MaxStringLength int + func (g Gen) GenMapEncodersForType(gti *GenTypeInfo, w io.Writer) error + func (g Gen) GenTupleEncodersForType(gti *GenTypeInfo, w io.Writer) error + func (g Gen) PrintHeaderAndUtilityMethods(w io.Writer, pkg string, typeInfos []*GenTypeInfo) error + func (g Gen) WriteMapEncodersToFile(fname, pkg string, types ...interface{}) error + func (g Gen) WriteTupleEncodersToFile(fname, pkg string, types ...interface{}) error + type GenTypeInfo struct + Fields []Field + Name string + Transparent bool + func ParseTypeInfo(itype interface{}) (*GenTypeInfo, error) + func (gti *GenTypeInfo) Imports() []Import + func (gti GenTypeInfo) MapHeader() []byte + func (gti GenTypeInfo) MapHeaderAsByteString() string + func (gti GenTypeInfo) TupleHeader() []byte + func (gti GenTypeInfo) TupleHeaderAsByteString() string + type Import struct + Name string + PkgPath string + func ImportsForType(currPkg string, t reflect.Type) []Import