v2

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FinalValueT = iota + 1
	StringT
	BytesT
	Float64T
	Float32T
	MapT
	ArrT
	Int64T
	Int32T
	Int16T
	Int8T
	Uint64T
	Uint32T
	Uint16T
	Uint8T
	BoolT
)

Variables

View Source
var (
	//ErrInvalidInput is used for when the input it invalid
	ErrInvalidInput = errors.New("invalid input")
)

Functions

func AddValue

func AddValue(slice *bytes.Buffer, v *Value)

func BoolFromBytes

func BoolFromBytes(buf []byte) bool

func BoolToBytes

func BoolToBytes(b *bool, buf *[]byte)

func Float32FromBytes

func Float32FromBytes(buf []byte) float32

func Float32ToBytes

func Float32ToBytes(f *float32, ret *[]byte)

func Float32ToBytes3

func Float32ToBytes3(f *float32, ret *[]byte)

func Float64FromBytes

func Float64FromBytes(buf []byte) float64

func Float64ToBytes

func Float64ToBytes(f *float64, ret *[]byte)

func GetLocs

func GetLocs(b []byte, locs []uint64, len uint32)

GetLocs gets the location data from an array

func Getkeylen

func Getkeylen(buf []byte) keylen

func Getvaluelen

func Getvaluelen(buf []byte) valuelen

func Int16FromBytes

func Int16FromBytes(buf []byte) int16

func Int16ToBytes

func Int16ToBytes(f int16) []byte

func Int32FromBytes

func Int32FromBytes(buf []byte) int32

func Int32ToBytes

func Int32ToBytes(f int32) []byte

func Int64FromBytes

func Int64FromBytes(buf []byte) int64

func Int64ToBytes

func Int64ToBytes(f int64, buf *[8]byte)

func Int8FromBytes

func Int8FromBytes(buf []byte) int8

func Int8ToBytes

func Int8ToBytes(f *int8, buf *[]byte)

func StringFromBytes

func StringFromBytes(b []byte) string

func StringToBytes

func StringToBytes(s string) []byte

func Uint16FromBytes

func Uint16FromBytes(buf []byte) uint16

func Uint16ToBytes

func Uint16ToBytes(f uint16) []byte

func Uint32FromBytes

func Uint32FromBytes(buf []byte) uint32

func Uint32ToBytes

func Uint32ToBytes(f uint32) []byte

func Uint64FromBytes

func Uint64FromBytes(buf []byte) uint64

func Uint64ToBytes

func Uint64ToBytes(f uint64) []byte

func Uint8FromBytes

func Uint8FromBytes(buf byte) uint8

func Uint8ToBytes

func Uint8ToBytes(f *uint8, buf *[]byte)

Types

type Ikeytype

type Ikeytype uint32

type Key

type Key struct {
	Value []byte //the key to the data of this object in its final form
	Vtype byte   //the type of the data of this object in its final form
}

Key is the key used for storing the key of a Value

func (*Key) Export

func (k *Key) Export() interface{}

type Value

type Value struct {
	Key      Key        //the key of this object in its final form
	Children []Ikeytype //the key to the values in the data send across
	Value    []byte     //the key to the data of this object in its final form
	Vtype    byte       //the type of the data of this object in its final form
}

Value is the type that contains the value data

func (*Value) FromBytes

func (v *Value) FromBytes(data []byte)

func (*Value) Len

func (v *Value) Len() int

func (*Value) Tobytes

func (v *Value) Tobytes(buf *bytes.Buffer)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL