Documentation ¶
Overview ¶
Package goerasure wraps the Jerasure C library in a Go object oriented interface that allows the user to perform erasure coding operations in Go using various erasure codes.
Index ¶
- func CreateAndPrint(r, c, w int)
- func Decode(stripeName string, code Coder) (err error)
- func Encode(stripeName string, code Coder) (err error)
- func PrintMatrix(matrix []int, r, c, w int)
- type BlockWriter
- type Coder
- func NewBlaumRothCode(k, m, w, packetSize int, bufferSize int64) Coder
- func NewCauchyGoodCode(k, m, w, packetSize int, bufferSize int64) Coder
- func NewCauchyOrigCode(k, m, w, packetSize int, bufferSize int64) Coder
- func NewLiber8tionCode(k, m, w, packetSize int, bufferSize int64) Coder
- func NewLiberationCode(k, m, w, packetSize int, bufferSize int64) Coder
- func NewReedSolVanCode(k, m, w, packetSize int, bufferSize int64) Coder
- type LenReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
The Encode function takes in a stripe name, where the stripe name is the base name of a stripe of data blocks. It then encodes the data blocks with the specified coder and writes the coding blocks to disc.
func PrintMatrix ¶
PrintMatrix prints the contents of a coding matrix.
Types ¶
type BlockWriter ¶
type Coder ¶
type Coder interface { // Encode data and produce parity for the given code. Encode(data, coding [][]byte) // Decode data and parity with the specified erasures taken into // account for the given code. Decode(data, coding [][]byte, erasures []int) // ValidateCode ensures that the coding parameters follow the // specific code's requirements. ValidateCode() // PrintInfo prints the coding parameters. PrintInfo() // Ensure that the file size is compatible with the coding parameters. CheckFileSize(size int64) // K retrieves the number of data blocks. K() int // M retrueves the number of parity blocks. M() int // Buffersize retrieves the buffer size Buffersize() int64 }
Coder impliments the interface that is used to endode and decode data. It also implements validity checking across codes and getter methods that allow for the retrieval of required variables.
func NewBlaumRothCode ¶
NewBlaumRothCode returns a type of bitmatrix code with both the bitmatrix and schedule initialised.
func NewCauchyGoodCode ¶
NewCaucheGoodCode returns a type of bitmatrix code with both the bitmatrix and schedule initialised.
func NewCauchyOrigCode ¶
NewCaucheOrigCode returns a type of bitmatrix code with both the bitmatrix and schedule initialised.
func NewLiber8tionCode ¶
NewLiber8tionCode returns a type of bitmatrix code with both the bitmatrix and schedule initialised.
func NewLiberationCode ¶
NewLiberationCode returns a type of bitmatrix code with both the bitmatrix and schedule initialised.
func NewReedSolVanCode ¶
NewReedSolVanCode returns a Reed-Solomon code, and initialising the coding matrix to a Vandermonde matrix