filesystem

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package filesystem provides a filesystem-based scan source.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilesystemSource

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

FilesystemSource is a filesystem-based scan source.

func New

func New(root string, opts ...Option) *FilesystemSource

New creates a new FilesystemSource. The root path is cleaned and resolved to an absolute path.

func (*FilesystemSource) Chunks

func (s *FilesystemSource) Chunks(ctx context.Context) <-chan source.Chunk

Chunks walks the filesystem and sends chunks over a channel.

func (*FilesystemSource) Type

func (s *FilesystemSource) Type() string

Type returns the source type.

func (*FilesystemSource) Validate

func (s *FilesystemSource) Validate() error

Validate checks that the root directory exists and is readable.

type Option

type Option func(*FilesystemSource)

Option configures a FilesystemSource.

func WithBufferSize

func WithBufferSize(size int) Option

WithBufferSize sets the chunk channel buffer size.

func WithExcludeExtensions

func WithExcludeExtensions(exts []string) Option

WithExcludeExtensions sets file extensions to exclude from scanning.

func WithExcludePaths

func WithExcludePaths(paths []string) Option

WithExcludePaths sets path patterns to exclude from scanning.

func WithMaxFileSize

func WithMaxFileSize(size int64) Option

WithMaxFileSize sets the maximum file size to scan.

Jump to

Keyboard shortcuts

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