Documentation
¶
Index ¶
- Constants
- func Dump(r []byte) (s string)
- func IsBool(raw Tag) bool
- func IsFloat(raw Tag) bool
- func IsInt(tag Tag) bool
- func IsNum(raw Tag) bool
- type Emitter
- func (e Emitter) AppendArray(b []byte, l int) []byte
- func (e Emitter) AppendBool(b []byte, v bool) []byte
- func (e Emitter) AppendBreak(b []byte) []byte
- func (e Emitter) AppendBytes(b, s []byte) []byte
- func (e Emitter) AppendFloat(b []byte, v float64) []byte
- func (e Emitter) AppendFloat32(b []byte, v float32) []byte
- func (e Emitter) AppendInt(b []byte, v int) []byte
- func (e Emitter) AppendInt64(b []byte, v int64) []byte
- func (e Emitter) AppendLabel(b []byte, x int) []byte
- func (e Emitter) AppendMap(b []byte, l int) []byte
- func (e Emitter) AppendNegUint64(b []byte, v uint64) []byte
- func (e Emitter) AppendNone(b []byte) []byte
- func (e Emitter) AppendNull(b []byte) []byte
- func (e Emitter) AppendSimple(b []byte, x Tag) []byte
- func (e Emitter) AppendString(b []byte, s string) []byte
- func (e Emitter) AppendTag(b []byte, tag Tag, v int) []byte
- func (e Emitter) AppendTag64(b []byte, tag Tag, v uint64) []byte
- func (e Emitter) AppendTagBreak(b []byte, tag Tag) []byte
- func (e Emitter) AppendTagBytes(b []byte, tag Tag, s []byte) []byte
- func (e Emitter) AppendTagString(b []byte, tag Tag, s string) []byte
- func (e Emitter) AppendTagUnsigned(b []byte, tag Tag, v uint64) []byte
- func (e Emitter) AppendUint(b []byte, v uint) []byte
- func (e Emitter) AppendUint64(b []byte, v uint64) []byte
- func (e Emitter) AppendUndefined(b []byte) []byte
- func (e Emitter) InsertLen(b []byte, tag Tag, st, l0, l int) []byte
- func (e Emitter) Tag64Size(v int64) int
- func (e Emitter) TagSize(v int) int
- type Error
- type FeatureFlags
- type Iterator
- func (d Iterator) Break(b []byte, i *int) bool
- func (d Iterator) Bytes(b []byte, st int) (v []byte, i int)
- func (d Iterator) Float(b []byte, st int) (v float64, i int)
- func (d Iterator) Float32(b []byte, st int) (v float32, i int)
- func (d Iterator) Label(b []byte, st int) (lab, i int)
- func (d Iterator) Raw(b []byte, st int) ([]byte, int)
- func (d Iterator) Signed(b []byte, st int) (v int64, i int)
- func (d Iterator) Simple(b []byte, st int) Tag
- func (d Iterator) Skip(b []byte, st int) (i int)
- func (d Iterator) SkipTag(b []byte, st int) (tag Tag, sub int64, i int)
- func (d Iterator) Tag(b []byte, st int) (tag Tag, l int64, i int)
- func (d Iterator) TagOnly(b []byte, st int) (tag Tag)
- func (d Iterator) TagRaw(b []byte, st int) (tag Tag)
- func (d Iterator) Unsigned(b []byte, st int) (v uint64, i int)
- func (d Iterator) UnwrapLabels(b []byte, st int) (i int)
- type Message
- type Reader
- type Tag
Constants ¶
View Source
const ( FtFloat8Int FeatureFlags FtFloat16 FtDefault = FtFloat8Int FtCompatible = FtFloat16 )
View Source
const ( ErrOK = iota ErrShortBuffer ErrIncompatible ErrMalformed ErrUnexpectedEOF ErrOverflow )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Emitter ¶
type Emitter struct {
Flags FeatureFlags
}
func MakeEmitter ¶
func MakeEmitter() Emitter
func (Emitter) AppendBreak ¶
func (Emitter) AppendBytes ¶
func (Emitter) AppendNone ¶
func (Emitter) AppendNull ¶
func (Emitter) AppendTagString ¶
func (Emitter) AppendTagUnsigned ¶
func (Emitter) AppendUndefined ¶
func (Emitter) InsertLen ¶
InsertLen inserts length l before value starting at st copying the value bytes forward if needed. It's needed to encode the value of unknown size. You first expect lenth to take one byte, encodes the value and then inserts length moving the value if encoded length size exceeds one byte.
expectedLen := 0 b = e.AppendTag(b, tag, expectedLen) st := len(b) b = append(b, ...) // arbitrary value of arbitrary size l := len(b) - st // for string or bytes // or l = array/map length b = e.InsertLen(b, tag, st, expectedLen, l)
type FeatureFlags ¶
type FeatureFlags int
func (FeatureFlags) Is ¶
func (f FeatureFlags) Is(ff FeatureFlags) bool
type Iterator ¶
type Iterator struct {
Flags FeatureFlags
}
func MakeIterator ¶
func MakeIterator() Iterator
Click to show internal directories.
Click to hide internal directories.