Documentation
¶
Index ¶
- func TakeBinHeader(src unsafe.Pointer, lim int) (int, unsafe.Pointer)
- func TakeBool(src unsafe.Pointer, lim int) (bool, unsafe.Pointer)
- func TakeBytes(src unsafe.Pointer, lim int, sBuf *SafeBuffer) ([]byte, unsafe.Pointer)
- func TakeFloat32(src unsafe.Pointer, lim int) (float32, unsafe.Pointer)
- func TakeFloat64(src unsafe.Pointer, lim int) (float64, unsafe.Pointer)
- func TakeInt(src unsafe.Pointer, lim int) (int, unsafe.Pointer)
- func TakeInt8(src unsafe.Pointer, lim int) (int8, unsafe.Pointer)
- func TakeInt16(src unsafe.Pointer, lim int) (int16, unsafe.Pointer)
- func TakeInt32(src unsafe.Pointer, lim int) (int32, unsafe.Pointer)
- func TakeInt64(src unsafe.Pointer, lim int) (int64, unsafe.Pointer)
- func TakeMapHeader(src unsafe.Pointer, lim int) (int, unsafe.Pointer)
- func TakeSliceHeader(src unsafe.Pointer, lim int) (int, unsafe.Pointer)
- func TakeStrHeader(src unsafe.Pointer, lim int) (int, unsafe.Pointer)
- func TakeString(src unsafe.Pointer, lim int, sBuf *SafeBuffer) (string, unsafe.Pointer)
- func TakeUint(src unsafe.Pointer, lim int) (uint, unsafe.Pointer)
- func TakeUint8(src unsafe.Pointer, lim int) (uint8, unsafe.Pointer)
- func TakeUint16(src unsafe.Pointer, lim int) (uint16, unsafe.Pointer)
- func TakeUint32(src unsafe.Pointer, lim int) (uint32, unsafe.Pointer)
- func TakeUint64(src unsafe.Pointer, lim int) (uint64, unsafe.Pointer)
- type ErrorCode
- type SafeBuffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TakeBinHeader ¶
TakeBinHeader reads Binary header of Msgpack ([]byte data). Returns the size of the slice in bytes and updated pointer.
func TakeBool ¶
TakeBool reads a boolean value from Msgpack. Returns the boolean value and an updated pointer.
func TakeBytes ¶
TakeBytes reads a byte slice from Msgpack, copies its content into the SafeBuffer, and returns a long-lived []byte that safely survives the temporary Tarantool buffer.
func TakeFloat32 ¶
TakeFloat32 reads numeric value into float32.
func TakeFloat64 ¶
TakeFloat64 reads numeric value into float64.
func TakeMapHeader ¶
TakeMapHeader read Map header of Msgpack. Returns a number of elements (key-value pairs) in there and updated pointer.
func TakeSliceHeader ¶
TakeSliceHeader read Array header of Msgpack. Returns a number of elements in there and updated pointer.
func TakeStrHeader ¶
TakeStrHeader reads String header of Msgpack. Returns the size of the string in bytes and updated pointer.
func TakeString ¶
TakeString reads a string from Msgpack, copies its content into the SafeBuffer, and returns a long-lived string that safely survives the temporary Tarantool buffer.
func TakeUint16 ¶
TakeUint16 reads numeric value uinto uint16.
func TakeUint32 ¶
TakeUint32 reads numeric value uinto uint32.
Types ¶
type ErrorCode ¶
type ErrorCode int
const ( ErrorSliceExhausted ErrorCode = iota ErrorSliceHeaderTruncated ErrorSliceHeaderCorrupted ErrorMapExhausted ErrorMapHeaderTruncated ErrorMapHeaderCorrupted ErrorStrExhausted ErrorStrHeaderTruncated ErrorStrHeaderCorrupted ErrorStrLenConflict ErrorBinExhausted ErrorBinHeaderTruncated ErrorBinHeaderCorrupted ErrorBinLenConflict ErrorNumberExhausted ErrorNumberTruncated ErrorIntCorrupted ErrorUintCorrupted ErrorFloatCorrupted ErrorIntOverflow ErrorUintOverflow ErrorBoolExhausted ErrorBoolCorrupted ErrorStructExhausted ErrorStructCorrupted ErrorUnknownField ErrorRequiredFieldMissing )
type SafeBuffer ¶
type SafeBuffer struct {
// contains filtered or unexported fields
}
SafeBuffer buffer for safe storage of strings and bytes for msgpack data from temporary buffer.
func NewSafeBuffer ¶
func NewSafeBuffer() *SafeBuffer
NewSafeBuffer creates safe buffer with preallocated bytes.
func (*SafeBuffer) AllocBytes ¶
func (b *SafeBuffer) AllocBytes(data unsafe.Pointer, size int) []byte
AllocBytes safely stores data referenced with pointer and the size as a []byte.
func (*SafeBuffer) AllocString ¶
func (b *SafeBuffer) AllocString(data unsafe.Pointer, size int) string
AllocString safely stores data referenced with pointer and the size as a string.