Documentation ¶
Index ¶
- Constants
- Variables
- func AssembleItemFromLinks(links []format.Link) ([]blocks.Block, *merkledag.ProtoNode, error)
- func GenerateCarHeader(root cid.Cid) ([]byte, error)
- func GetBlockStreamFromItem(ctx context.Context, handler datasource.ReadHandler, itemPart model.ItemPart, ...) (<-chan BlockResult, fs.Object, error)
- func GetCommp(calc *commp.Calc, targetPieceSize uint64) (cid.Cid, uint64, error)
- func GetMultiWriter(outDir string) (io.WriteCloser, *commp.Calc, string, error)
- func IsSameEntry(ctx context.Context, item model.Item, object fs.Object) (bool, string)
- func Min(i int, i2 int) int
- func WriteCarBlock(writer io.Writer, block blocks.Block) (int64, error)
- func WriteCarHeader(writer io.Writer, root cid.Cid) ([]byte, error)
- type BlockResult
- type CarResult
- type Result
- type WriteCloser
Constants ¶
View Source
const ChunkSize int64 = 1 << 20
View Source
const NumLinkPerNode = 1024
Variables ¶
View Source
var ErrItemModified = errors.New("item has been modified")
Functions ¶
func AssembleItemFromLinks ¶ added in v0.1.0
func AssembleItemFromLinks(links []format.Link) ([]blocks.Block, *merkledag.ProtoNode, error)
AssembleItemFromLinks creates a new UnixFS parent node from child links. This function handles constructing layers of parent nodes. It returns the additional blocks, the root node, and an error if any.
func GenerateCarHeader ¶ added in v0.1.0
func GetBlockStreamFromItem ¶ added in v0.1.0
func GetBlockStreamFromItem(ctx context.Context, handler datasource.ReadHandler, itemPart model.ItemPart, encryptor encryption.Encryptor) (<-chan BlockResult, fs.Object, error)
GetBlockStreamFromItem streams an item from the handler and encrypts it. It returns a channel of blocks, the object, and an error if any.
func GetMultiWriter ¶ added in v0.1.0
func IsSameEntry ¶ added in v0.2.14
Types ¶
type BlockResult ¶
Click to show internal directories.
Click to hide internal directories.