Documentation ¶
Index ¶
- func DefaultWalkFunc(nd format.Node) ([]*format.Link, error)
- func HeaderSize(h *CarHeader) (uint64, error)
- func WriteCar(ctx context.Context, ds format.NodeGetter, roots []cid.Cid, w io.Writer) error
- func WriteCarWithWalker(ctx context.Context, ds format.NodeGetter, roots []cid.Cid, w io.Writer, ...) error
- func WriteHeader(h *CarHeader, w io.Writer) error
- type Block
- type CarHeader
- type CarReader
- type Dag
- type OnCarHeaderFunc
- type OnNewCarBlockFunc
- type ReadStore
- type SelectiveCar
- type SelectiveCarPrepared
- type Store
- type WalkFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HeaderSize ¶
func WriteCarWithWalker ¶
Types ¶
type CarReader ¶
type CarReader struct { Header *CarHeader // contains filtered or unexported fields }
type OnCarHeaderFunc ¶
OnCarHeaderFunc is called during traversal when the header is created
type OnNewCarBlockFunc ¶
OnNewCarBlockFunc is called during traveral when a new unique block is encountered
type SelectiveCar ¶
type SelectiveCar struct {
// contains filtered or unexported fields
}
SelectiveCar is a car file based on root + selector combos instead of just a single root and complete dag walk
func NewSelectiveCar ¶
func NewSelectiveCar(ctx context.Context, store ReadStore, dags []Dag) SelectiveCar
NewSelectiveCar creates a new SelectiveCar for the given car file based a block store and set of root+selector pairs
func (SelectiveCar) Prepare ¶
func (sc SelectiveCar) Prepare(userOnNewCarBlocks ...OnNewCarBlockFunc) (SelectiveCarPrepared, error)
Prepare traverse a car file and collects data on what is about to be written, but does not actually write the file
func (SelectiveCar) Write ¶
func (sc SelectiveCar) Write(w io.Writer, userOnNewCarBlocks ...OnNewCarBlockFunc) error
type SelectiveCarPrepared ¶
type SelectiveCarPrepared struct { SelectiveCar // contains filtered or unexported fields }
SelectiveCarPrepared is a SelectiveCar that has already been traversed, such that it can be written quicker with Dump. It also contains metadata already collection about the Car file like size and number of blocks that go into it
func (SelectiveCarPrepared) Cids ¶
func (sc SelectiveCarPrepared) Cids() []cid.Cid
Cids returns the list of unique block cids that will be written to the car file
func (SelectiveCarPrepared) Dump ¶
func (sc SelectiveCarPrepared) Dump(w io.Writer) error
Dump writes the car file as quickly as possible based on information already collected
func (SelectiveCarPrepared) Header ¶
func (sc SelectiveCarPrepared) Header() CarHeader
Header returns the header for the car file that will be written
func (SelectiveCarPrepared) Size ¶
func (sc SelectiveCarPrepared) Size() uint64
Size returns the total size in bytes of the car file that will be written