fileReader

package
v1.9.21-rc Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbsFn

type AbsFn = func(path string) (string, error)

type FileReader

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

func CreateFileReader

func CreateFileReader(opts *FileReaderOptions) *FileReader

func (*FileReader) FilterFiles

func (fr *FileReader) FilterFiles(paths []string, excludePattern string) ([]string, error)

func (*FileReader) GetFilename

func (fr *FileReader) GetFilename(path string) (string, error)

func (*FileReader) ReadDir

func (fr *FileReader) ReadDir(dirpath string) ([]string, error)

func (*FileReader) ReadFileContent

func (fr *FileReader) ReadFileContent(filepath string) (string, error)

type FileReaderOptions

type FileReaderOptions struct {
	ReadFile ReadFileFn
	Glob     GlobFn
	Stat     StatFn
	Abs      AbsFn
}

type GlobFn

type GlobFn = func(pattern string) ([]string, error)

type ReadFileFn

type ReadFileFn = func(filename string) ([]byte, error)

type StatFn

type StatFn = func(name string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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