visitor

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeCallback

type NodeCallback func(node model.Node, data []byte) error

NodeCallback is a function type that is called for each node created during the scan.

type ReaderPosition

type ReaderPosition interface {
	io.Reader
	Offset() uint64
}

func ReaderPositionFromReader

func ReaderPositionFromReader(r io.Reader) ReaderPosition

ReaderPositionFromReader creates a ReaderPosition from an io.Reader.

type Repo

type Repo interface {
	FindOrCreateRawNode(ctx context.Context, cid cid.Cid, size uint64, spaceDID did.DID, uploadID id.UploadID, path string, sourceID id.SourceID, offset uint64) (*model.RawNode, bool, error)
	FindOrCreateUnixFSNode(ctx context.Context, cid cid.Cid, size uint64, spaceDID did.DID, uploadID id.UploadID, ufsdata []byte, links []model.LinkParams) (*model.UnixFSNode, bool, error)
}

Repo defines the interface for a repository that manages file system entries during a scan

type UnixFSDirectoryNodeVisitor

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

A UnixFSDirectoryNodeVisitor provides a link system for [builder.BuildUnixFSDirectory] which visits produced nodes with [cb] as they're encoded.

func NewUnixFSDirectoryNodeVisitor

func NewUnixFSDirectoryNodeVisitor(ctx context.Context, repo Repo, spaceDID did.DID, uploadID id.UploadID, cb NodeCallback) UnixFSDirectoryNodeVisitor

NewUnixFSDirectoryNodeVisitor creates a new UnixFSDirectoryNodeVisitor.

func (UnixFSDirectoryNodeVisitor) LinkSystem

type UnixFSFileNodeVisitor

type UnixFSFileNodeVisitor struct {
	UnixFSDirectoryNodeVisitor
	// contains filtered or unexported fields
}

A UnixFSFileNodeVisitor provides a link system for [builder.BuildUnixFSFile] which visits produced nodes with [cb] as they're encoded.

func NewUnixFSFileNodeVisitor

func NewUnixFSFileNodeVisitor(ctx context.Context, repo Repo, spaceDID did.DID, uploadID id.UploadID, sourceID id.SourceID, path string, readerPosition ReaderPosition, cb NodeCallback) UnixFSFileNodeVisitor

func (UnixFSFileNodeVisitor) LinkSystem

func (v UnixFSFileNodeVisitor) LinkSystem() *linking.LinkSystem

type VisitNodeFunc

type VisitNodeFunc func(datamodelNode datamodel.Node, cid cid.Cid, data []byte) error

Jump to

Keyboard shortcuts

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