Documentation ¶
Index ¶
- Constants
- Variables
- type BasicEncoder
- type CborPayloadEncoder
- type DefiniteContainerEncoder
- type Encoder
- func (inst *Encoder) EncodeArrayDefinite(length uint64) (n int, err error)
- func (inst *Encoder) EncodeArrayIndefinite() (n int, err error)
- func (inst *Encoder) EncodeBool(val bool) (n int, err error)
- func (inst *Encoder) EncodeBreak() (n int, err error)
- func (inst *Encoder) EncodeByteSlice(b []byte) (n int, err error)
- func (inst *Encoder) EncodeCborPayload(val []byte) (n int, err error)
- func (inst *Encoder) EncodeFloat32(val float32) (n int, err error)
- func (inst *Encoder) EncodeFloat64(val float64) (n int, err error)
- func (inst *Encoder) EncodeInt(val int64) (int, error)
- func (inst *Encoder) EncodeIpAddr(val netip.Addr) (n int, err error)
- func (inst *Encoder) EncodeJsonPayload(val []byte) (n int, err error)
- func (inst *Encoder) EncodeMapDefinite(length uint64) (n int, err error)
- func (inst *Encoder) EncodeMapIndefinite() (n int, err error)
- func (inst *Encoder) EncodeNil() (n int, err error)
- func (inst *Encoder) EncodeString(str string) (n int, err error)
- func (inst *Encoder) EncodeTag16(val TagUint16) (int, error)
- func (inst *Encoder) EncodeTag32(val TagUint32) (int, error)
- func (inst *Encoder) EncodeTag64(val TagUint64) (int, error)
- func (inst *Encoder) EncodeTag8(val TagUint8) (int, error)
- func (inst *Encoder) EncodeTagSmall(val TagSmall) (int, error)
- func (inst *Encoder) EncodeTimeUTC(val time.Time) (n int, err error)
- func (inst *Encoder) EncodeUint(val uint64) (int, error)
- func (inst *Encoder) Hash(b []byte) (hash []byte, err error)
- func (inst *Encoder) Reset()
- func (inst *Encoder) SetHasher(hasher hash.Hash)
- func (inst *Encoder) SetWriter(w EncoderWriter)
- func (inst *Encoder) TagUint16(val TagUint16) (int, error)
- func (inst *Encoder) TagUint32(val TagUint32) (int, error)
- func (inst *Encoder) TagUint64(val TagUint64) (int, error)
- type EncoderWriter
- type FullEncoder
- type Generator
- type HashingEncoder
- type IndefiniteContainerEncoder
- type MajorType
- type PrimitiveEncoder
- type ResetableEncoder
- type TagEncoder
- type TagSmall
- type TagUint16
- type TagUint32
- type TagUint64
- type TagUint8
Constants ¶
View Source
const ( TagStandardDateTimeString TagSmall = 0 TagEpochDateTimeNumber TagSmall = 1 TagExpectConversionToBase64Url TagSmall = 21 TagExpectConversionToBase64Std TagSmall = 22 TagExpectConversionToHex TagSmall = 23 TagEncodedCBORDataItem TagUint8 = 24 TagReferenceNthPreviousString TagUint8 = 25 TagURIValue TagUint8 = 32 TagBase64Url TagUint8 = 33 TagBase64Std TagUint8 = 34 TagRegexp TagUint8 = 35 TagBinaryUUID TagUint8 = 37 TagMultiDimArrayRowMajor TagUint8 = 40 TagHomogenousArray TagUint8 = 41 TagIPv4 TagUint8 = 52 TagIPv6 TagUint8 = 54 TagEncodedCBORSequence TagUint8 = 63 TagTypedArrayUint8 TagUint8 = 64 TagTypedArrayUint16BE TagUint8 = 65 TagTypedArrayUint32BE TagUint8 = 66 TagTypedArrayUint64BE TagUint8 = 67 TagTypedArrayUint8Clamped TagUint8 = 68 TagTypedArrayUint16LE TagUint8 = 69 TagTypedArrayUint32LE TagUint8 = 70 TagTypedArrayUint64LE TagUint8 = 71 TagTypedArraySint8 TagUint8 = 72 TagTypedArraySint16BE TagUint8 = 73 TagTypedArraySint32BE TagUint8 = 74 TagTypedArraySint64BE TagUint8 = 75 TagTypedArraySint16LE TagUint8 = 77 TagTypedArraySint32LE TagUint8 = 78 TagTypedArraySint64LE TagUint8 = 79 TagTypedArrayFloat16BE TagUint8 = 80 TagTypedArrayFloat32BE TagUint8 = 81 TagTypedArrayFloat64BE TagUint8 = 82 TagTypedArrayFloat128BE TagUint8 = 83 TagTypedArrayFloat16LE TagUint8 = 84 TagTypedArrayFloat32LE TagUint8 = 85 TagTypedArrayFloat64LE TagUint8 = 86 TagTypedArrayFloat128LE TagUint8 = 87 TagTextMimeMessage TagUint8 = 36 TagBinaryMimeMessage TagUint16 = 257 TagMathematicalFiniteSet TagUint16 = 258 TagEmbeddedJSON TagUint16 = 262 TagHexString TagUint16 = 263 TagMapStringKeysOnly TagUint16 = 275 TagMultiDimArrayColumnMajor TagUint16 = 1040 TagSelfDescribedCBOR TagUint16 = 55799 TagFileContainsCBORSeq TagUint16 = 55800 )
View Source
const MaxTagSmallIncl uint8 = 23
Variables ¶
View Source
var ErrNoHasher = eh.Errorf("no hasher")
Functions ¶
This section is empty.
Types ¶
type BasicEncoder ¶
type BasicEncoder interface { PrimitiveEncoder DefiniteContainerEncoder ResetableEncoder CborPayloadEncoder }
type CborPayloadEncoder ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func NewEncoder(w EncoderWriter, hasher hash.Hash) *Encoder
func (*Encoder) EncodeArrayDefinite ¶
func (*Encoder) EncodeArrayIndefinite ¶
func (*Encoder) EncodeBreak ¶
func (*Encoder) EncodeCborPayload ¶
func (*Encoder) EncodeJsonPayload ¶
func (*Encoder) EncodeMapDefinite ¶
func (*Encoder) EncodeMapIndefinite ¶
func (*Encoder) EncodeTimeUTC ¶
func (*Encoder) SetWriter ¶
func (inst *Encoder) SetWriter(w EncoderWriter)
type EncoderWriter ¶
type EncoderWriter interface { io.ByteWriter io.Writer io.StringWriter }
type FullEncoder ¶
type FullEncoder interface { BasicEncoder IndefiniteContainerEncoder HashingEncoder TagEncoder }
type Generator ¶
type Generator struct { MaxNestingLevel int Hasher hash.Hash64 Enc *Encoder MaxTotalPrimitives int // contains filtered or unexported fields }
func NewGenerator ¶
func NewGenerator(w EncoderWriter, randSeed int64) *Generator
func (*Generator) GenerateRandomCbor ¶
func (*Generator) GenerateRandomCborScalar ¶
func (*Generator) SetMaxStringLength ¶
type HashingEncoder ¶
type MajorType ¶
type MajorType uint8
const MajorTypeArray MajorType = 4
const MajorTypeByteString MajorType = 2
const MajorTypeFloatOrSimple MajorType = 7
const MajorTypeMap MajorType = 5
const MajorTypeNegativeInt MajorType = 1
const MajorTypePositiveInt MajorType = 0
const MajorTypeTag MajorType = 6
const MajorTypeUtf8String MajorType = 3
type PrimitiveEncoder ¶
type PrimitiveEncoder interface { EncodeUint(val uint64) (int, error) EncodeInt(val int64) (int, error) EncodeByteSlice(val []byte) (int, error) EncodeString(val string) (int, error) EncodeBool(val bool) (int, error) EncodeFloat32(val float32) (int, error) EncodeFloat64(val float64) (int, error) EncodeTimeUTC(val time.Time) (int, error) EncodeNil() (int, error) }
type ResetableEncoder ¶
type ResetableEncoder interface { Reset() SetWriter(dest EncoderWriter) }
type TagEncoder ¶
Click to show internal directories.
Click to hide internal directories.