erasurecode

package module
v0.0.0-...-c959020 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnownBackends = [...]string{
	"null",
	"jerasure_rs_vand",
	"jerasure_rs_cauchy",
	"flat_xor_hd",
	"isa_l_rs_vand",
	"shss",
	"liberasurecode_rs_vand",
	"isa_l_rs_cauchy",
	"libphazr",
}

Functions

func AvailableBackends

func AvailableBackends() (avail []string)

func BackendIsAvailable

func BackendIsAvailable(name string) bool

func ReadFragment

func ReadFragment(reader io.Reader) ([]byte, error)

Types

type Backend

type Backend struct {
	Params
	// contains filtered or unexported fields
}

func InitBackend

func InitBackend(params Params) (Backend, error)

func (*Backend) Close

func (backend *Backend) Close() error

func (*Backend) Decode

func (backend *Backend) Decode(frags [][]byte) ([]byte, error)

func (*Backend) Encode

func (backend *Backend) Encode(data []byte) ([][]byte, error)

func (*Backend) GetFileWriter

func (backend *Backend) GetFileWriter(prefix string, perm os.FileMode) (io.WriteCloser, error)

func (*Backend) IsInvalidFragment

func (backend *Backend) IsInvalidFragment(frag []byte) bool

func (*Backend) Reconstruct

func (backend *Backend) Reconstruct(frags [][]byte, fragIndex int) ([]byte, error)

type ECWriter

type ECWriter struct {
	Backend *Backend
	Writers []io.WriteCloser
}

func (ECWriter) Close

func (shim ECWriter) Close() error

func (ECWriter) Write

func (shim ECWriter) Write(p []byte) (int, error)

type FragmentInfo

type FragmentInfo struct {
	Index               int
	Size                int
	BackendMetadataSize int
	OrigDataSize        uint64
	BackendID           C.ec_backend_id_t
	BackendName         string
	BackendVersion      Version
	ErasureCodeVersion  Version
	IsValid             bool
	MetadataChecksum    uint32
}

func GetFragmentInfo

func GetFragmentInfo(frag []byte) FragmentInfo

type Params

type Params struct {
	Name string
	K    int
	M    int
	W    int
	HD   int
}

type Version

type Version struct {
	Major    uint
	Minor    uint
	Revision uint
}

func GetVersion

func GetVersion() Version

func (Version) Less

func (v Version) Less(other Version) bool

func (Version) String

func (v Version) String() string

Directories

Path Synopsis
cmd
ec-info command
ec-split command

Jump to

Keyboard shortcuts

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