Documentation ¶
Index ¶
- func Join(in []io.Reader, s Strategy) (io.Reader, error)
- func JoinSimple(in []io.Reader) (io.Reader, error)
- func JoinTreewalk(in []io.Reader) (io.Reader, error)
- func NewCarMerger(in []io.Reader) (io.Reader, error)
- type BlockReader
- type SimpleSplitter
- type Splitter
- type Strategy
- type TreewalkSplitter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinSimple ¶ added in v0.1.1
Join together multiple CAR files that were split using the "simple" strategy into a single CAR file.
func JoinTreewalk ¶ added in v0.3.0
Join together multiple CAR files into a single CAR file using the "treewalk" strategy. Note that binary equality between the original CAR and the joined CAR is not guaranteed.
Types ¶
type BlockReader ¶ added in v0.4.0
type SimpleSplitter ¶ added in v0.4.0
type SimpleSplitter struct {
// contains filtered or unexported fields
}
func NewSimpleSplitter ¶ added in v0.4.0
func NewSimpleSplitter(in io.Reader, targetSize int) (*SimpleSplitter, error)
Create a new CAR file splitter to create multiple smaller CAR files using the "simple" strategy.
type Splitter ¶ added in v0.4.0
type Strategy ¶
type Strategy int
Strategy describes how CAR files should be split.
const ( // Simple is fast but naive, only the first CAR output has a root CID, // subsequent CARs have a placeholder "empty" CID. Simple Strategy = iota // Treewalk walks the DAG to pack sub-graphs into each CAR file that is // output. Every CAR has the same root CID, but contains a different portion // of the DAG. Treewalk )
type TreewalkSplitter ¶ added in v0.4.0
type TreewalkSplitter struct {
// contains filtered or unexported fields
}
func NewTreewalkSplitter ¶ added in v0.4.0
func NewTreewalkSplitter(r io.Reader, targetSize int) (*TreewalkSplitter, error)
Split a CAR file and create multiple smaller CAR files using the "treewalk" strategy. Note: the entire CAR will be cached in memory. Use NewTreewalkSplitterFromPath or NewTreewalkSplitterFromBlockReader for non-memory bound splitting.
func NewTreewalkSplitterFromBlockReader ¶ added in v0.4.0
func NewTreewalkSplitterFromBlockReader(root cid.Cid, br BlockReader, targetSize int) (*TreewalkSplitter, error)
Split a CAR file (passed as a root CID and a block reader populated with the blocks from the CAR) and create multiple smaller CAR files using the "treewalk" strategy.
func NewTreewalkSplitterFromPath ¶ added in v0.4.0
func NewTreewalkSplitterFromPath(path string, targetSize int) (*TreewalkSplitter, error)
Split a CAR file found on disk at the given path and create multiple smaller CAR files using the "treewalk" strategy.