Documentation ¶
Index ¶
- Constants
- Variables
- func BareBytes(o Object) []byte
- func Bytes(o Object) []byte
- func BytesOf(ww WritableToWriter) []byte
- func CmdOfPayload(b []byte) uint32
- func Name(o Object) string
- func Pretty(o Object) string
- func ReadBare(o Object, data []byte) error
- type Object
- type Reader
- func (r *Reader) Cmd() uint32
- func (r *Reader) Err() error
- func (r *Reader) ExpectCmd(cmds ...uint32) bool
- func (r *Reader) ExpectEOF()
- func (r *Reader) Fail(err error)
- func (r *Reader) PeekCmd() uint32
- func (r *Reader) PeekUint32() uint32
- func (r *Reader) ReadBigInt() *big.Int
- func (r *Reader) ReadBlob() []byte
- func (r *Reader) ReadBlobLen() (int, int)
- func (r *Reader) ReadBool() bool
- func (r *Reader) ReadByte() byte
- func (r *Reader) ReadCmd() uint32
- func (r *Reader) ReadFloat64() float64
- func (r *Reader) ReadFull(b []byte)
- func (r *Reader) ReadInt() int
- func (r *Reader) ReadN(n int) []byte
- func (r *Reader) ReadString() string
- func (r *Reader) ReadTimeSec32() time.Time
- func (r *Reader) ReadToEnd() []byte
- func (r *Reader) ReadUint128(buf []byte) bool
- func (r *Reader) ReadUint32() uint32
- func (r *Reader) ReadUint64() uint64
- func (r *Reader) ReadVectorLong() []uint64
- func (r *Reader) Reset(data []byte)
- func (r *Reader) Skip(n int)
- func (r *Reader) StartInnerCmd() uint32
- func (r *Reader) TryReadByte() (byte, bool)
- func (r *Reader) TryReadUint24() (uint32, bool)
- func (r *Reader) TryReadUint32() (uint32, bool)
- func (r *Reader) TryReadUint64() (uint64, bool)
- type Schema
- func (schema *Schema) DescribeCmd(cmd uint32) string
- func (schema *Schema) DescribeCmdOfPayload(raw []byte) string
- func (schema *Schema) MustReadBoxedObject(raw []byte) Object
- func (schema *Schema) ReadBoxedObject(raw []byte) (Object, error)
- func (schema *Schema) ReadBoxedObjectFrom(r *Reader) Object
- func (schema *Schema) ReadBoxedObjectNoEOFCheck(raw []byte) (Object, error)
- func (schema *Schema) ReadLimitedBoxedObject(raw []byte, cmds ...uint32) (Object, error)
- func (schema *Schema) ReadLimitedBoxedObjectFrom(r *Reader, cmds ...uint32) Object
- func (schema *Schema) ReadLimitedBoxedObjectNoEOFCheck(raw []byte, cmds ...uint32) (Object, error)
- type WritableToWriter
- type Writer
- func (w *Writer) Bytes() []byte
- func (w *Writer) Clear()
- func (w *Writer) PaddingTo(bs int) int
- func (w *Writer) Write(v []byte)
- func (w *Writer) WriteBigInt(v *big.Int)
- func (w *Writer) WriteBlob(v []byte)
- func (w *Writer) WriteBlobLen(v int) int
- func (w *Writer) WriteBool(v bool)
- func (w *Writer) WriteByte(v byte)
- func (w *Writer) WriteCmd(v uint32)
- func (w *Writer) WriteFloat64(v float64)
- func (w *Writer) WriteInt(v int)
- func (w *Writer) WriteString(s string)
- func (w *Writer) WriteTimeSec32(tm time.Time)
- func (w *Writer) WriteUint128(v []byte)
- func (w *Writer) WriteUint24(v uint32)
- func (w *Writer) WriteUint32(v uint32)
- func (w *Writer) WriteUint64(v uint64)
- func (w *Writer) WriteVectorLong(v []uint64)
- func (w *Writer) ZeroPad(n int)
Constants ¶
View Source
const ( IDVectorLong uint32 = 0x1cb5c415 TagGzipPacked uint32 = 0x3072cfa1 )
Variables ¶
View Source
var ErrMessageTooShort = errors.New("message too short")
View Source
var ErrTrailingData = errors.New("unexpected trailing data")
View Source
var ErrUnexpectedCommand = errors.New("unexpected command")
Functions ¶
func BytesOf ¶
func BytesOf(ww WritableToWriter) []byte
func CmdOfPayload ¶
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func DecodeObject ¶
func (*Reader) PeekUint32 ¶
func (*Reader) ReadBigInt ¶
func (*Reader) ReadBlobLen ¶
func (*Reader) ReadFloat64 ¶
func (*Reader) ReadString ¶
func (*Reader) ReadTimeSec32 ¶
func (*Reader) ReadUint128 ¶
func (*Reader) ReadUint32 ¶
func (*Reader) ReadUint64 ¶
func (*Reader) ReadVectorLong ¶
func (*Reader) StartInnerCmd ¶
func (*Reader) TryReadByte ¶
func (*Reader) TryReadUint24 ¶
func (*Reader) TryReadUint32 ¶
func (*Reader) TryReadUint64 ¶
type Schema ¶
func (*Schema) DescribeCmd ¶
func (*Schema) DescribeCmdOfPayload ¶
func (*Schema) MustReadBoxedObject ¶
func (*Schema) ReadBoxedObjectFrom ¶
func (*Schema) ReadBoxedObjectNoEOFCheck ¶
func (*Schema) ReadLimitedBoxedObject ¶
func (*Schema) ReadLimitedBoxedObjectFrom ¶
type WritableToWriter ¶
type WritableToWriter interface {
WriteTo(w *Writer)
}
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewWriterCmd ¶
func (*Writer) WriteBigInt ¶
func (*Writer) WriteBlobLen ¶
func (*Writer) WriteFloat64 ¶
func (*Writer) WriteString ¶
func (*Writer) WriteTimeSec32 ¶
func (*Writer) WriteUint128 ¶
func (*Writer) WriteUint24 ¶
func (*Writer) WriteUint32 ¶
func (*Writer) WriteUint64 ¶
func (*Writer) WriteVectorLong ¶
Click to show internal directories.
Click to hide internal directories.