Versions in this module Expand all Collapse all v1 v1.9.3 Sep 27, 2019 Changes in this version + var ErrInvShardNum = errors.New("cannot create Encoder with zero or less data/parity shards") + var ErrInvalidInput = errors.New("invalid input") + var ErrMaxShardNum = errors.New("cannot create Encoder with more than 256 data+parity shards") + var ErrReconstructMismatch = errors.New("valid shards and fill shards are mutually exclusive") + var ErrReconstructRequired = errors.New("reconstruction required as one or more required data shards are nil") + var ErrShardNoData = errors.New("no shard data") + var ErrShardSize = errors.New("shard sizes do not match") + var ErrShortData = errors.New("not enough data to fill the number of requested shards") + var ErrTooFewShards = errors.New("too few shards given") + type Encoder interface + Encode func(shards [][]byte) error + Join func(dst io.Writer, shards [][]byte, outSize int) error + Reconstruct func(shards [][]byte) error + ReconstructData func(shards [][]byte) error + Split func(data []byte) ([][]byte, error) + Update func(shards [][]byte, newDatashards [][]byte) error + Verify func(shards [][]byte) (bool, error) + func New(dataShards, parityShards int, opts ...Option) (Encoder, error) + type Option func(*options) + func WithAutoGoroutines(shardSize int) Option + func WithCauchyMatrix() Option + func WithMaxGoroutines(n int) Option + func WithMinSplitSize(n int) Option + func WithPAR1Matrix() Option + type StreamEncoder interface + Encode func(data []io.Reader, parity []io.Writer) error + Join func(dst io.Writer, shards []io.Reader, outSize int64) error + Reconstruct func(valid []io.Reader, fill []io.Writer) error + Split func(data io.Reader, dst []io.Writer, size int64) (err error) + Verify func(shards []io.Reader) (bool, error) + func NewStream(dataShards, parityShards int, o ...Option) (StreamEncoder, error) + func NewStreamC(dataShards, parityShards int, conReads, conWrites bool, o ...Option) (StreamEncoder, error) + type StreamReadError struct + Err error + Stream int + func (s StreamReadError) Error() string + func (s StreamReadError) String() string + type StreamWriteError struct + Err error + Stream int + func (s StreamWriteError) Error() string + func (s StreamWriteError) String() string