nfs

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 13 Imported by: 6

Documentation

Overview

Package nfs implements a scan module for discovering and crawling NFS shares.

Index

Constants

View Source
const Label = "Nfs"

Variables

This section is empty.

Functions

func CheckSetup

func CheckSetup() error

CheckSetup checks whether Setup() executed accordingly. Scan arguments should be checked by the scanner.

func Setup

func Setup(logger utils.Logger) error

Setup configures the environment accordingly, if the scan module has some special requirements. A successful setup is required before a scan can be started.

Types

type Result

type Result struct {
	filecrawler.Result // nfs result wrapped filecrawler result to allow broker distinguishing smb/nfs results by type
}

type Scanner

type Scanner struct {
	Label    string
	Started  time.Time
	Finished time.Time
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(
	logger utils.Logger,
	target string,
	crawlDepth int,
	threads int,
	excludedShares []string,
	excludedFolders []string,
	excludedExtensions []string,
	excludedLastModifiedBelow time.Time,
	excludedFileSizeBelow int,
	onlyAccessibleFiles bool,
	mountTimeout time.Duration,
) (*Scanner, error)

func (*Scanner) Run

func (s *Scanner) Run(timeout time.Duration) (res *Result)

Run starts scan execution. This must either be executed as a goroutine, or another thread must be active listening on the scan's result channel, in order to avoid a deadlock situation.

func (*Scanner) SetContext added in v1.1.0

func (s *Scanner) SetContext(ctx context.Context)

SetContext can be used to pass an existing context from outside. If timeout is supplied later when calling Run() the external context and the deadline context will be combined. Once set, the context cannot be changed anymore, because it might have been wrapped internally already.

Jump to

Keyboard shortcuts

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