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 Option
- 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 Option ¶ added in v0.3.2
type Option func(*options)
Option describes an option which affects behavior when interacting with the interface.
func MaxTraversalLinks ¶ added in v0.3.2
MaxTraversalLinks changes the allowed number of links a selector traversal can execute before failing.
Note that setting this option may cause an error to be returned from selector execution when building a SelectiveCar.
func TraverseLinksOnlyOnce ¶ added in v0.3.2
func TraverseLinksOnlyOnce() Option
TraverseLinksOnlyOnce prevents the traversal engine from repeatedly visiting the same links more than once.
This can be an efficient strategy for an exhaustive selector where it's known that repeat visits won't impact the completeness of execution. However it should be used with caution with most other selectors as repeat visits of links for different reasons during selector execution can be valid and necessary to perform full traversal.
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 ¶
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 ¶
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