dirscan

package
v0.0.0-...-e8cbe11 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithOS

func WithOS(os OS) func(s *Scanner)

Types

type File

type File struct {
	Name string
	Size int64
	Path string
}

type FileWrapper

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

func NewFileWrapper

func NewFileWrapper(file *os.File) FileWrapper

func (FileWrapper) Close

func (f FileWrapper) Close() error

func (FileWrapper) Readdir

func (f FileWrapper) Readdir(n int) ([]os.FileInfo, error)

type OS

type OS interface {
	Stat(name string) (os.FileInfo, error)
	Open(name string) (OSFile, error)
	IsNotExist(err error) bool
}

type OSFile

type OSFile interface {
	Readdir(n int) ([]os.FileInfo, error)
	Close() error
}

type OSWrapper

type OSWrapper struct {
}

func NewOSWrapper

func NewOSWrapper() OSWrapper

func (OSWrapper) IsNotExist

func (o OSWrapper) IsNotExist(err error) bool

func (OSWrapper) Open

func (o OSWrapper) Open(name string) (OSFile, error)

func (OSWrapper) Stat

func (o OSWrapper) Stat(name string) (fileInfo os.FileInfo, err error)

type Scanner

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

func NewScanner

func NewScanner(allowedExtensions []string, opts ...func(scanner *Scanner)) (scanner Scanner)

func (Scanner) GetFileList

func (s Scanner) GetFileList(dirPath string) (list []File, err error)

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