Documentation ¶
Index ¶
- Variables
- func CompleteMethods(file *assets.File, gos *GenerationOptions) (err error)
- func GetBool(p []byte, stackIndex uint32) bool
- func GetBoolArray(p []byte, stackIndex uint32) (slice []bool)
- func GetByte(p []byte, stackIndex uint32) byte
- func GetByteArray(p []byte, stackIndex uint32) (slice []byte)
- func GetComplex128(p []byte, stackIndex uint32) complex128
- func GetComplex128Array(p []byte, stackIndex uint32) (slice []complex128)
- func GetComplex64(p []byte, stackIndex uint32) complex64
- func GetComplex64Array(p []byte, stackIndex uint32) (slice []complex64)
- func GetFixedByteArray(p []byte, stackIndex uint32, n uint32) (array []byte)
- func GetFloat32(p []byte, stackIndex uint32) float32
- func GetFloat32Array(p []byte, stackIndex uint32) (slice []float32)
- func GetFloat64(p []byte, stackIndex uint32) float64
- func GetFloat64Array(p []byte, stackIndex uint32) (slice []float64)
- func GetInt16(p []byte, stackIndex uint32) int16
- func GetInt16Array(p []byte, stackIndex uint32) (slice []int16)
- func GetInt32(p []byte, stackIndex uint32) int32
- func GetInt32Array(p []byte, stackIndex uint32) (slice []int32)
- func GetInt64(p []byte, stackIndex uint32) int64
- func GetInt64Array(p []byte, stackIndex uint32) (slice []int64)
- func GetInt8(p []byte, stackIndex uint32) int8
- func GetInt8Array(p []byte, stackIndex uint32) (slice []int8)
- func GetString(p []byte, stackIndex uint32) string
- func GetStringArray(p []byte, stackIndex uint32) (slice []string)
- func GetUInt16(p []byte, stackIndex uint32) uint16
- func GetUInt16Array(p []byte, stackIndex uint32) (slice []uint16)
- func GetUInt32(p []byte, stackIndex uint32) uint32
- func GetUInt32Array(p []byte, stackIndex uint32) (slice []uint32)
- func GetUInt64(p []byte, stackIndex uint32) uint64
- func GetUInt64Array(p []byte, stackIndex uint32) (slice []uint64)
- func GetUInt8(p []byte, stackIndex uint32) uint8
- func Marshal(s interface{}, offset int) (p []byte, err error)
- func SetArray(p []byte, stackIndex uint32, a []byte)
- func SetBool(p []byte, stackIndex uint32, b bool)
- func SetBoolArray(p []byte, s []bool, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetByte(p []byte, stackIndex uint32, b byte)
- func SetByteArray(p []byte, s []byte, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetComplex128(p []byte, stackIndex uint32, n complex128)
- func SetComplex128Array(p []byte, s []complex128, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetComplex64(p []byte, stackIndex uint32, n complex64)
- func SetComplex64Array(p []byte, s []complex64, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetFloat32(p []byte, stackIndex uint32, n float32)
- func SetFloat32Array(p []byte, s []float32, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetFloat64(p []byte, stackIndex uint32, n float64)
- func SetFloat64Array(p []byte, s []float64, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetInt16(p []byte, stackIndex uint32, n int16)
- func SetInt16Array(p []byte, s []int16, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetInt32(p []byte, stackIndex uint32, n int32)
- func SetInt32Array(p []byte, s []int32, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetInt64(p []byte, stackIndex uint32, n int64)
- func SetInt64Array(p []byte, s []int64, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetInt8(p []byte, stackIndex uint32, n int8)
- func SetInt8Array(p []byte, s []int8, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetString(p []byte, s string, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetStringArray(p []byte, s []string, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetUInt16(p []byte, stackIndex uint32, n uint16)
- func SetUInt16Array(p []byte, s []uint16, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetUInt32(p []byte, stackIndex uint32, n uint32)
- func SetUInt32Array(p []byte, s []uint32, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetUInt64(p []byte, stackIndex uint32, n uint64)
- func SetUInt64Array(p []byte, s []uint64, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
- func SetUInt8(p []byte, stackIndex uint32, n uint8)
- func UnMarshal(p []byte, s interface{}) (err error)
- func UnsafeGetBoolArray(p []byte, stackIndex uint32) (slice []bool)
- func UnsafeGetByteArray(p []byte, stackIndex uint32) []byte
- func UnsafeGetComplex128Array(p []byte, stackIndex uint32) (slice []complex128)
- func UnsafeGetComplex64Array(p []byte, stackIndex uint32) (slice []complex64)
- func UnsafeGetFloat32Array(p []byte, stackIndex uint32) (slice []float32)
- func UnsafeGetFloat64Array(p []byte, stackIndex uint32) (slice []float64)
- func UnsafeGetInt16Array(p []byte, stackIndex uint32) (slice []int16)
- func UnsafeGetInt32Array(p []byte, stackIndex uint32) (slice []int32)
- func UnsafeGetInt64Array(p []byte, stackIndex uint32) (slice []int64)
- func UnsafeGetInt8Array(p []byte, stackIndex uint32) []int8
- func UnsafeGetString(p []byte, stackIndex uint32) string
- func UnsafeGetStringArray(p []byte, stackIndex uint32) (slice []string)
- func UnsafeGetUInt16Array(p []byte, stackIndex uint32) (slice []uint16)
- func UnsafeGetUInt32Array(p []byte, stackIndex uint32) (slice []uint32)
- func UnsafeGetUInt64Array(p []byte, stackIndex uint32) (slice []uint64)
- type GenerationOptions
Constants ¶
This section is empty.
Variables ¶
var ( ErrSyllabNeededTypeNotExist = errorr.New().SetDetail(lang.EnglishLanguage, "Syllab - Needed Type Not Exist", "Custom struct type exist in upper struct type that generator can't access it to know its fields").Save() ErrSyllabFieldType = errorr.New().SetDetail(lang.EnglishLanguage, "Syllab - Field Type", "Requested type may include function, interface, int, uint, ... field type that can't encode||decode").Save() ErrSyllabArrayLen = errorr.New().SetDetail(lang.EnglishLanguage, "Syllab - Array Len", "Length of array larger than 32 bit space that syllab can encode||decode").Save() ErrSyllabDecodeSmallSlice = errorr.New().SetDetail(lang.EnglishLanguage, "Syllab - Decode Small Slice", "Given slice smaller than expected to decode data from it").Save() ErrSyllabDecodeHeapOverFlow = errorr.New().SetDetail(lang.EnglishLanguage, "Syllab - Decode Heap OverFlow", "Encoded syllab want to access to out of slice.").Save() )
Declare Errors Details
Functions ¶
func CompleteMethods ¶
func CompleteMethods(file *assets.File, gos *GenerationOptions) (err error)
CompleteMethods use to update given go files and complete Syllab encoder&&decoder to any struct type in it! It will overwrite given file methods! If you need it clone it before pass it here!
func GetBoolArray ¶
GetBoolArray decodes bool array from the payload buffer!
func GetByteArray ¶
GetByteArray decodes byte||uint8 array from the payload buffer!
func GetComplex128 ¶
func GetComplex128(p []byte, stackIndex uint32) complex128
GetComplex128 decodes COMPLEX128 from the payload buffer.
func GetComplex128Array ¶
func GetComplex128Array(p []byte, stackIndex uint32) (slice []complex128)
GetComplex128Array decode fixed size Complex128 array from the payload buffer
func GetComplex64 ¶
GetComplex64 decodes COMPLEX64 from the payload buffer.
func GetComplex64Array ¶
GetComplex64Array decode fixed size Complex64 array from the payload buffer
func GetFixedByteArray ¶
GetFixedByteArray decodes fixed sized byte array from the payload buffer. If you want array instead of slice from function below, You can copy function and edit it for your usage! e.g. for get a [2]byte ```var array [2]byte = copy(array[:], p[stackIndex:])``` for get a [32]byte ```var array [32]byte = copy(array[:], p[stackIndex:])```
func GetFloat32 ¶
GetFloat32 decodes FLOAT32 from the payload buffer.
func GetFloat32Array ¶
GetFloat32Array decode fixed size Float32 array from the payload buffer
func GetFloat64 ¶
GetFloat64 decodes FLOAT64 from the payload buffer.
func GetFloat64Array ¶
GetFloat64Array decode fixed size Float64 array from the payload buffer
func GetInt16Array ¶
GetInt16Array decode Int16 array from the payload buffer
func GetInt32Array ¶
GetInt32Array decode fixed size Int32 array from the payload buffer
func GetInt64Array ¶
GetInt64Array decode fixed size Int64 array from the payload buffer
func GetInt8Array ¶
GetInt8Array decodes int8 array from the payload buffer!
func GetStringArray ¶
GetStringArray encode string array to the payload buffer!
func GetUInt16Array ¶
GetUInt16Array decode UInt16 array from the payload buffer
func GetUInt32Array ¶
GetUInt32Array decode fixed size UInt32 array from the payload buffer
func GetUInt64Array ¶
GetUInt64Array decode fixed size UInt64 array from the payload buffer
func Marshal ¶
Marshal encodes the value of s to the payload buffer in runtime. offset add free space by given number at begging of return slice that almost just use in sRPC protocol! It can be 0!!
func SetBoolArray ¶
SetBoolArray encode bool array to the payload buffer!
func SetByteArray ¶
SetByteArray encode byte array || uint8 array to the payload buffer!
func SetComplex128 ¶
func SetComplex128(p []byte, stackIndex uint32, n complex128)
SetComplex128 encode COMPLEX128 to the payload buffer.
func SetComplex128Array ¶
func SetComplex128Array(p []byte, s []complex128, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
SetComplex128Array encode complex128 array to the payload buffer!
func SetComplex64 ¶
SetComplex64 encode COMPLEX64 to the payload buffer.
func SetComplex64Array ¶
func SetComplex64Array(p []byte, s []complex64, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
SetComplex64Array encode complex64 array to the payload buffer!
func SetFloat32 ¶
SetFloat32 encode FLOAT32 to the payload buffer.
func SetFloat32Array ¶
func SetFloat32Array(p []byte, s []float32, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
SetFloat32Array encode float32 array to the payload buffer!
func SetFloat64 ¶
SetFloat64 encode FLOAT64 to the payload buffer.
func SetFloat64Array ¶
func SetFloat64Array(p []byte, s []float64, stackIndex uint32, heapAddr uint32) (nextHeapAddr uint32)
SetFloat64Array encode float64 array to the payload buffer!
func SetInt16Array ¶
SetInt16Array encode int16 array to the payload buffer!
func SetInt32Array ¶
SetInt32Array encode int32 array to the payload buffer!
func SetInt64Array ¶
SetInt64Array encode int64 array to the payload buffer!
func SetInt8Array ¶
SetInt8Array encode int8 array to the payload buffer!
func SetStringArray ¶
SetStringArray encode string array to the payload buffer!
func SetUInt16Array ¶
SetUInt16Array encode uint16 array to the payload buffer!
func SetUInt32Array ¶
SetUInt32Array encode uint32 array to the payload buffer!
func SetUInt64Array ¶
SetUInt64Array encode uint64 array to the payload buffer!
func UnMarshal ¶
UnMarshal decode payload and stores the result in the value pointed to by s in runtime.
func UnsafeGetBoolArray ¶
UnsafeGetBoolArray decodes bool array from the payload buffer!
func UnsafeGetByteArray ¶
UnsafeGetByteArray decodes byte slice from the payload buffer in unsafe manner!
func UnsafeGetComplex128Array ¶
func UnsafeGetComplex128Array(p []byte, stackIndex uint32) (slice []complex128)
UnsafeGetComplex128Array decode fixed size Complex128 array from the payload buffer
func UnsafeGetComplex64Array ¶
UnsafeGetComplex64Array decode fixed size Complex64 array from the payload buffer
func UnsafeGetFloat32Array ¶
UnsafeGetFloat32Array decode fixed size Float32 array from the payload buffer
func UnsafeGetFloat64Array ¶
UnsafeGetFloat64Array decode fixed size Float64 array from the payload buffer
func UnsafeGetInt16Array ¶
UnsafeGetInt16Array decode Int16 array from the payload buffer
func UnsafeGetInt32Array ¶
UnsafeGetInt32Array decode fixed size Int32 array from the payload buffer
func UnsafeGetInt64Array ¶
UnsafeGetInt64Array decode fixed size Int64 array from the payload buffer
func UnsafeGetInt8Array ¶
UnsafeGetInt8Array decodes int8 slice from the payload buffer in unsafe manner!
func UnsafeGetString ¶
UnsafeGetString decodes string from the payload buffer in unsafe manner!
func UnsafeGetStringArray ¶
UnsafeGetStringArray encode string array to the payload buffer!
func UnsafeGetUInt16Array ¶
UnsafeGetUInt16Array decode UInt16 array from the payload buffer
func UnsafeGetUInt32Array ¶
UnsafeGetUInt32Array decode fixed size UInt32 array from the payload buffer
func UnsafeGetUInt64Array ¶
UnsafeGetUInt64Array decode fixed size UInt64 array from the payload buffer
Types ¶
type GenerationOptions ¶
type GenerationOptions struct { UnSafe bool // true means don't copy data from given payload||buffer and just point to it for decoding fields! buffer can't GC until decoded struct free! ForceUpdate bool // true means delete exiting codes and update encoders && decoders codes anyway! }
GenerationOptions indicate generator behavior!