Versions in this module Expand all Collapse all v0 v0.0.1 Mar 22, 2025 Changes in this version + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelNone + const LogLevelWarn + var ErrEmptyShards = errors.New("空分片数组") + var ErrInvShardNum = errors.New("无效的分片数量") + var ErrInvalidInput = errors.New("无效的输入数据") + var ErrInvalidOutput = errors.New("无效的输出缓冲区") + var ErrInvalidShardSize = errors.New("分片大小不满足要求,通常是N的倍数") + var ErrInvalidShards = errors.New("无效的分片数据") + var ErrMaxShardNum = errors.New("分片数量超过最大支持数") + var ErrNilWriter = errors.New("目标写入器不能为nil") + var ErrNotSupported = errors.New("operation not supported") + var ErrReconstructMismatch = errors.New("一个分片不能同时是输入和输出") + var ErrReconstructRequired = errors.New("需要先进行数据重建") + var ErrShardNoData = errors.New("分片中没有数据") + var ErrShardSize = errors.New("分片大小不一致") + var ErrShortData = errors.New("数据不足,无法填充请求的分片数量") + var ErrSize = errors.New("无效的大小参数") + var ErrTooFewShards = errors.New("可用分片数量不足,无法重建数据") + var GF8Bridge = newGF8Bridge() + func AllocAligned(shards, each int) [][]byte + func GaloisAdd(a, b byte) byte + func GaloisDivide(a, b byte) byte + func GaloisExp(a byte, n int) byte + func GaloisMultiply(a, b byte) byte + func SetLogger(l Logger) + type Extensions interface + AllocAligned func(each int) [][]byte + DataShards func() int + ParityShards func() int + ShardSizeMultiple func() int + TotalShards func() int + type Logger interface + Debug func(msg string, args ...interface{}) + Error func(msg string, args ...interface{}) + Info func(msg string, args ...interface{}) + SetLevel func(level int) + Warn func(msg string, args ...interface{}) + type ReedSolomon interface + AllocAligned func(shards, each int) [][]byte + DataShards func() int + Encode func(shards [][]byte) error + Join func(dst io.Writer, shards [][]byte, outSize int) error + ParityShards func() int + Reconstruct func(shards [][]byte) error + ReconstructData func(shards [][]byte) error + ShardSizeMultiple func() int + Split func(data []byte) ([][]byte, error) + StreamEncode func(inputs []io.Reader, outputs []io.Writer) error + StreamJoin func(dst io.Writer, shards []io.Reader, outSize int64) error + StreamReconstruct func(inputs []io.Reader, outputs []io.Writer) error + StreamReconstructData func(inputs []io.Reader, outputs []io.Writer) error + StreamSplit func(data io.Reader, dst []io.Writer, size int64) error + StreamVerify func(shards []io.Reader) (bool, error) + TotalShards func() int + Verify func(shards [][]byte) (bool, error) + WithConcurrency func(n int) ReedSolomon + func New(dataShards, parityShards int) (ReedSolomon, error) + func New16(dataShards, parityShards int) (ReedSolomon, error) + func New8(dataShards, parityShards int) (ReedSolomon, error) + type StreamEncoder16 interface + Encode func(inputs []io.Reader, outputs []io.Writer) error + Join func(dst io.Writer, shards []io.Reader, outSize int64) error + Reconstruct func(inputs []io.Reader, outputs []io.Writer) error + Split func(data io.Reader, dst []io.Writer, size int64) error + Verify func(shards []io.Reader) (bool, error) + type StreamEncoder8 interface + Encode func(inputs []io.Reader, outputs []io.Writer) error + Join func(dst io.Writer, shards []io.Reader, outSize int64) error + Reconstruct func(inputs []io.Reader, outputs []io.Writer) error + Split func(data io.Reader, dst []io.Writer, size int64) error + Verify func(shards []io.Reader) (bool, error) + type StreamReadError struct + Err error + Stream int + func (e StreamReadError) Error() string + type StreamWriteError struct + Err error + Stream int + func (e StreamWriteError) Error() string