fileIO

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FilesBuffer = 8
)

Functions

func DriveTypeNames

func DriveTypeNames() []string

DriveTypeNames returns a list of possible string values of DriveType.

func Enumerate

func Enumerate(typeMask DriveType) ([]string, error)

Types

type DriveType

type DriveType int

ENUM( Unknown=0 Removable=1 Fixed=2 Remote=4 CDRom=8 RAM=16 )

const (
	// DriveTypeUnknown is a DriveType of type Unknown
	DriveTypeUnknown DriveType = iota
	// DriveTypeRemovable is a DriveType of type Removable
	DriveTypeRemovable
	// DriveTypeFixed is a DriveType of type Fixed
	DriveTypeFixed
	// DriveTypeRemote is a DriveType of type Remote
	DriveTypeRemote DriveType = iota + 1
	// DriveTypeCDRom is a DriveType of type CDRom
	DriveTypeCDRom DriveType = iota + 4
	// DriveTypeRAM is a DriveType of type RAM
	DriveTypeRAM DriveType = iota + 11
)

func ParseDriveType

func ParseDriveType(name string) (DriveType, error)

ParseDriveType attempts to convert a string to a DriveType

func (DriveType) MarshalText

func (x DriveType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (DriveType) String

func (x DriveType) String() string

String implements the Stringer interface.

func (*DriveType) UnmarshalText

func (x *DriveType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type FSScanProgress

type FSScanProgress struct {
	File    File
	Matches []yara.MatchRule
	Error   error
}

type FSScanner

type FSScanner struct {
	NGoroutines int
	// contains filtered or unexported fields
}

func NewFSScanner

func NewFSScanner(scanner FileScanner) *FSScanner

func (*FSScanner) Scan

func (s *FSScanner) Scan(it Iterator) (<-chan *FSScanProgress, error)

type File

type File interface {
	Path() string
	Stat() (os.FileInfo, error)
}

type FileScanner

type FileScanner interface {
	ScanFile(filename string) (results []yara.MatchRule, err error)
}

type Iterator

type Iterator interface {
	Next() (File, error)
	Close() error
}

func Concat

func Concat(iterators ...Iterator) Iterator

func Concurrent

func Concurrent(iterators ...Iterator) Iterator

func IteratePath

func IteratePath(path string, validExtensions []string, ctx context.Context) (Iterator, error)

Jump to

Keyboard shortcuts

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