Documentation ¶
Overview ¶
Package erasure provides a common API for various erasure codes. It adds optional checksumming.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code interface { // Encode accepts a byte slice and returns a slice of sharded data. Encode([]byte) ([][]byte, error) // Decode accepts a slice of (possibly nil) shards and returns the original // byte slice. Decode([][]byte) ([]byte, error) // Shards returns the total number of data + parity shards employed by this // erasure code. Shards() int }
Code is a simple abstraction on top of a specific erasure code implementation.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reconstructs a data stream.
type Writer ¶
type Writer struct { // ChunkSize is the number of bytes that will be used for each parity // calculation. If this is less than 1, 1e7 (~10MB) is used. ChunkSize int // contains filtered or unexported fields }
Writer implements the io.Writer interface.
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
shard
Shard provides a very simple interface for sharding data coming from stdin and saving it to shard files, or reading from shard files and writing the output to stdout.
|
Shard provides a very simple interface for sharding data coming from stdin and saving it to shard files, or reading from shard files and writing the output to stdout. |
Package null provides a null encoding for erasure.
|
Package null provides a null encoding for erasure. |
Package reedsolomon provides a Reed-Solomon erasure code.
|
Package reedsolomon provides a Reed-Solomon erasure code. |
Click to show internal directories.
Click to hide internal directories.