traversal

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package traversal provides abstraction and implementation needed to traverse all chunks below a given root hash. It tries to parse all manifests and collections in its attempt to log all chunk addresses on the way.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidTrie = errors.New("traversal: invalid trie data")
View Source
var (
	// ErrInvalidType is returned when the reference was not expected type.
	ErrInvalidType = errors.New("traversal: invalid type")
)

Functions

This section is empty.

Types

type Service

type Service interface {
	// TraverseAddresses iterates through each address related to the supplied
	// one, if possible.
	TraverseAddresses(context.Context, boson.Address, boson.AddressIterFunc) error

	// TraverseBytesAddresses iterates through each address of a bytes.
	TraverseBytesAddresses(context.Context, boson.Address, boson.AddressIterFunc) error
	// TraverseFileAddresses iterates through each address of a file.
	TraverseFileAddresses(context.Context, boson.Address, boson.AddressIterFunc) error
	// TraverseManifestAddresses iterates through each address of a manifest,
	// as well as each entry found in it.
	TraverseManifestAddresses(context.Context, boson.Address, boson.AddressIterFunc) error

	GetTrieData(context.Context, boson.Address) (map[string][]byte, error)

	CheckTrieData(context.Context, boson.Address, map[string][]byte) ([][][]byte, error)
}

Service is the service to find dependent chunks for an address.

func NewService

func NewService(storer storage.Storer) Service

Jump to

Keyboard shortcuts

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