partitioning

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

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

func (*DataSplit) SplitDataInChunks

func (ds *DataSplit) SplitDataInChunks(data [][]byte, limit int) ([][][]byte, error)

SplitDataInChunks splits the provided data into smaller chunks limit is expressed in number of elements

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) PackDataInChunks

func (sdp *SizeDataPacker) PackDataInChunks(data [][]byte, limit int) ([][]byte, error)

PackDataInChunks packs the provided data into smaller chunks limit is expressed in bytes

Jump to

Keyboard shortcuts

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