scan

package
v0.0.0-...-20afc43 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package scan provides a scanner for scanning archives into metadatas.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WalkDirIter

func WalkDirIter(fsys fs.FS, root string) func(func(WalkDirEntry) bool)

WalkDirIter returns an iterator that can be used to iterate over the contents of a directory. It uses WalkDir under the hood. To skip a directory, call the SkipDir method on an entry.

Types

type ScanResult

type ScanResult struct {
	Meta plugins.MetadataV1
	Path string
}

type Scanner

type Scanner struct {
	Plugins []plugins.PluginV1
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(plugins ...plugins.PluginV1) *Scanner

NewScanner creates a new scanner with the given plugins.

func (*Scanner) Init

func (s *Scanner) Init()

Init prints the version of the plugins.

func (*Scanner) Scan

func (s *Scanner) Scan() func(func(ScanResult) bool)

Scan scans the archive at the given path and returns the metadata.

type WalkDirEntry

type WalkDirEntry struct {
	Path  string
	Entry fs.DirEntry
	Err   error
	// contains filtered or unexported fields
}

func (WalkDirEntry) SkipDir

func (entry WalkDirEntry) SkipDir()

SkipDir causes the iteration to skip the contents of the entry. This will have no effect if called outside the iteration for this particular entry.

Directories

Path Synopsis
anchira module

Jump to

Keyboard shortcuts

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