Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMalformedCar = errors.New("malformed CAR") ErrBadVersion = errors.New("bad CAR version") ErrBadRoots = errors.New("CAR root CID mismatch") ErrUnexpectedBlock = errors.New("unexpected block in CAR") ErrExtraneousBlock = errors.New("extraneous block in CAR") ErrMissingBlock = errors.New("missing block in CAR") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Root cid.Cid // The single root we expect to appear in the CAR and that we use to run our traversal against AllowCARv2 bool // If true, allow CARv2 files to be received, otherwise strictly only allow CARv1 Selector selector.Selector // The selector to execute, starting at the provided Root, to verify the contents of the CAR }
func (Config) Verify ¶
func (cfg Config) Verify(ctx context.Context, rdr io.Reader, lsys linking.LinkSystem) (uint64, uint64, error)
Verify reads a CAR from the provided reader, verifies the contents are strictly what is specified by this Config and writes the blocks to the provided BlockWriteOpener. It returns the number of blocks and bytes written to the BlockWriteOpener.
Verification is performed according to the CAR construction rules contained within the Trustless, and Path Gateway specifications:
Click to show internal directories.
Click to hide internal directories.