dirscanner

package
v0.0.0-...-0bc2699 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirScanner

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

DirScanner encapsulates the logic for scanning a directory hierarchy and generating FileUpload objects from the files within.

func New

func New(fs fs.FS, processors []Processor, numThreads int) *DirScanner

New instantiates a new directory scanner instance with the provided options.

func (*DirScanner) Scan

func (s *DirScanner) Scan(ctx context.Context) error

Scan traverses the filesystem and runs all registered processors on all regular files.

type Processor

type Processor interface {
	Process(ctx context.Context, path string) (*processor.File, error)
}

Processor is the interface required to handle file uploads produced by the DirScanner instance.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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