Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSplit ¶
type DataSplit struct { }
DataSplit can split a large slice of byte slices in chunks with len(chunks) <= limit It does not marshal the data
type SimpleDataPacker ¶
type SimpleDataPacker struct {
// contains filtered or unexported fields
}
SimpleDataPacker can split a large slice of byte slices in chunks <= maxPacketSize If one element still exceeds maxPacketSize, it will be returned alone It does the marshaling of the resulted (smaller) slice of byte slices This is a simpler version of a data packer that does not marshall in a repetitive manner currentChunk slice as the SizeDataPacker does. This limitation is lighter in terms of CPU cycles and memory used but is not as precise as SizeDataPacker.
func NewSimpleDataPacker ¶
func NewSimpleDataPacker(marshalizer marshal.Marshalizer) (*SimpleDataPacker, error)
NewSimpleDataPacker creates a new SizeDataPacker instance
func (*SimpleDataPacker) IsInterfaceNil ¶
func (sdp *SimpleDataPacker) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SimpleDataPacker) PackDataInChunks ¶
func (sdp *SimpleDataPacker) PackDataInChunks(data [][]byte, limit int) ([][]byte, error)
PackDataInChunks packs the provided data into smaller chunks limit is expressed in bytes
type SizeDataPacker ¶
type SizeDataPacker struct {
// contains filtered or unexported fields
}
SizeDataPacker can split a large slice of byte slices in chunks <= maxPacketSize If one element still exceeds maxPacketSize, it will be returned alone It does the marshaling of the resulted (smaller) slice of byte slices
func NewSizeDataPacker ¶
func NewSizeDataPacker(marshalizer marshal.Marshalizer) (*SizeDataPacker, error)
NewSizeDataPacker creates a new SizeDataPacker instance
func (*SizeDataPacker) IsInterfaceNil ¶
func (sdp *SizeDataPacker) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SizeDataPacker) PackDataInChunks ¶
func (sdp *SizeDataPacker) PackDataInChunks(data [][]byte, limit int) ([][]byte, error)
PackDataInChunks packs the provided data into smaller chunks limit is expressed in bytes