reedsolomon

package
v0.0.0-...-68d8c1a Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Codec uint64 = 0x700 // random number // TODO Register in IPFS codec table.

Custom codec for Reed-Solomon recovery Nodes.

Variables

This section is empty.

Functions

func DecodeNode

func DecodeNode(b blocks.Block) (format.Node, error)

func MarshalNode

func MarshalNode(n *Node) ([]byte, error)

func NewEncoder

func NewEncoder(dag format.DAGService) recovery.Encoder

NewEncoder creates new Reed-Solomon Encoder.

func NewRecoverer

func NewRecoverer(ctx context.Context, dag format.DAGService, strg recovery.Strategy) recovery.Recoverer

NewRecoverer creates new Reed-Solomon Recoverer. Strategy have to be an option,

Types

type Node

type Node struct {
	*merkledag.ProtoNode
	// contains filtered or unexported fields
}

Node is a recovery Node based ob Reed-Solomon coding.

func Encode

func Encode(ctx context.Context, dag format.DAGService, nd format.Node, r recovery.Recoverability) (*Node, error)

TODO Refactor to use Shards Encode applies Reed-Solomon coding on the given IPLD Node promoting it to a recovery Node. Use `r` to specify needed amount of generated recovery Nodes.

func NewNode

func NewNode(nd format.Node) (*Node, error)

func UnmarshalNode

func UnmarshalNode(data []byte) (*Node, error)
func (n *Node) AddNodeLink(name string, that format.Node) error
func (n *Node) AddRawLink(name string, l *format.Link) error

Shadowed methods to reset caching.

func (*Node) AddRedundantNode

func (n *Node) AddRedundantNode(nd format.Node)

func (*Node) Cid

func (n *Node) Cid() cid.Cid

func (*Node) CidBuilder

func (n *Node) CidBuilder() cid.Builder

func (*Node) Copy

func (n *Node) Copy() format.Node

func (*Node) Proto

func (n *Node) Proto() *merkledag.ProtoNode

func (*Node) RawData

func (n *Node) RawData() []byte

func (*Node) Recoverability

func (n *Node) Recoverability() recovery.Recoverability
func (n *Node) RecoveryLinks() []*format.Link
func (n *Node) RemoveNodeLink(name string) error

func (*Node) RemoveRedundantNode

func (n *Node) RemoveRedundantNode(id cid.Cid)

func (*Node) SetCidBuilder

func (n *Node) SetCidBuilder(b cid.Builder)

func (*Node) SetData

func (n *Node) SetData(d []byte)

func (*Node) Size

func (n *Node) Size() (uint64, error)

func (*Node) Stat

func (n *Node) Stat() (*format.NodeStat, error)

func (*Node) String

func (n *Node) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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