index

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIntegrityError = errors.New("integrity error")
)
View Source
var (
	ErrInvalidInput = errors.New("invalid input")
)

Functions

func DirParts

func DirParts(p string) []string

Types

type DirInfoGenerator

type DirInfoGenerator func(filename string) *fs.FileInfo

type InMemoryTreeBuilder

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

InMemoryTreeBuilder maintains a tree in memory

func NewInMemoryTreeBuilder

func NewInMemoryTreeBuilder(directoryFn DirInfoGenerator) *InMemoryTreeBuilder

func (*InMemoryTreeBuilder) Index

func (t *InMemoryTreeBuilder) Index(infos []*fs.FileInfo) error

func (*InMemoryTreeBuilder) Readdir

func (t *InMemoryTreeBuilder) Readdir(entryPath string) (fs.FileInfoList, error)

func (*InMemoryTreeBuilder) Stat

func (t *InMemoryTreeBuilder) Stat(entryPath string) (*fs.FileInfo, error)

type Tree

type Tree interface {
	// Index accepts a sorted list of paths.
	// it creates a mapping of directory memberships and makes up for missing directory entries, if any.
	// (some indices have no directory entries at all, so those need to be created)
	Index(infos []*fs.FileInfo) error

	// Readdir returns the direct descendants of the given directory at entryPath
	Readdir(entryPath string) (fs.FileInfoList, error)

	// Stat returns in the FileInfo for the given file/directory at entryPath
	Stat(entryPath string) (*fs.FileInfo, error)
}

Jump to

Keyboard shortcuts

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