tool

package
v0.5.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2024 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractCarHandler

func ExtractCarHandler(ctx *cli.Context, inputDir string, output string, c cid.Cid) error

ExtractCarHandler extracts data from CAR (Content Addressable Archives) files found in the input directory. The extracted data is written to the specified output directory or file based on the given CID.

CAR files are used in IPFS and other content-addressable file systems to represent file content. They are essential for offline data transfer, backups, and other use cases where you might need to work with data without IPFS or another file system.

Parameters:

  • ctx: A pointer to a cli.Context object which provides access to the current command-line context.
  • inputDir: The directory path where the function will look for CAR files.
  • output: The destination path where the extracted content will be saved.
  • c: A CID (Content Identifier) which identifies the data block to be extracted from the CAR file.

Returns:

  • An error if any issues arise during the extraction process, otherwise nil.

Note:

The function only supports CAR files with CIDs of type raw or DagProtobuf.
It recursively walks the input directory and gathers all .car files.
For each CAR file, it reads the content and extracts the data for the given CID, then writes the extracted
content to the specified output directory or file. If no CAR files are found in the input directory,
an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL