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 ¶
WithBufferSize sets the chunk channel buffer size.
func WithExcludeExtensions ¶
WithExcludeExtensions sets file extensions to exclude from scanning.
func WithExcludePaths ¶
WithExcludePaths sets path patterns to exclude from scanning.
func WithMaxFileSize ¶
WithMaxFileSize sets the maximum file size to scan.