Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoGetters = errors.New("no Getters configured") ErrPartialContents = errors.New("target is not empty") ErrNothingToResume = errors.New("nothing to resume; target already the correct size, or is empty") ErrCantResume = errors.New("request can't be resumed") ErrShortWrite = errors.New("Getter returned too few bytes") ErrLongWrite = errors.New("Getter returned too many bytes") ErrSizeMismatch = errors.New("the ExpectedSize and the size returned from the verifier differ") ErrUndefinedCID = errors.New("missing/undefined CID") ErrInvalidExpectedSize = errors.New("invalid ExpectedSize") )
View Source
var ( ErrNoBlockGetters = errors.New("no BlockGetters configured") ErrBadBlock = errors.New("invalid block") )
Functions ¶
This section is empty.
Types ¶
type BlockGetter ¶
type Getter ¶
TODO: Document how Get should behave if the target size indicates the payload has been completely received. A nil error is insufficient because this could cause a Get to be wrongly regarded as verified. Perhaps a sentinel error?
type R ¶
type R struct { Getters []Getter BlockGetters []BlockGetter }
func (*R) GetBlock ¶
GetBlock returns the block with CID c it receives from one of the configured [BlockGetter]s. It confirms that the block's reported CID is equal to c, but assumes the BlockGetter has hashed the block.
Click to show internal directories.
Click to hide internal directories.