carutil

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const UnixfsChunkSize uint64 = 1 << 20
View Source
const UnixfsLinksPerLevel = 1 << 10

Variables

This section is empty.

Functions

func BuildFileNode

func BuildFileNode(ctx context.Context, item Finfo, bufDs ipld.DAGService, cidBuilder cid.Builder) (node ipld.Node, err error)

func CalculateCid added in v0.1.19

func CalculateCid(r io.Reader) (cid.Cid, error)

CalculateCid calculates the CID for the given reader.

func CreateCar added in v0.1.19

func CreateCar(inputPath string, outputPath string) (cid.Cid, error)

createCar creates a car

Types

type CarStream added in v0.1.19

type CarStream interface {
	io.ReadWriter
	io.ReaderAt
	io.WriterAt
	io.Seeker
}

CarStream is an interface that combines io.ReadWriter, io.ReaderAt, io.WriterAt, io.Seeker.

type CidMapValue

type CidMapValue struct {
	IsDir bool
	Cid   string
}

type FSBuilder

type FSBuilder struct {
	// contains filtered or unexported fields
}

func NewFSBuilder

func NewFSBuilder(root *dag.ProtoNode, ds ipld.DAGService) *FSBuilder

func (*FSBuilder) Build

func (b *FSBuilder) Build() (rootn *FsNode, err error)

type Finfo

type Finfo struct {
	Path  string
	Size  int64
	Start int64
	End   int64
}

type FsNode

type FsNode struct {
	Name string
	Hash string
	Size uint64
	Link []FsNode
}

func GenerateCar

func GenerateCar(ctx context.Context, fileList []Finfo, parentPath string, tmpDir string, output io.Writer) (ipldDag *FsNode, cid string, cidMap map[string]CidMapValue, err error)

Jump to

Keyboard shortcuts

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