fs

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type File

type File struct {
	Path       string
	Executable bool
}

type FileSystem

type FileSystem struct{}

FileSystem provides manipulation of file system.

func (*FileSystem) FindFiles

func (fs *FileSystem) FindFiles(paths []string, filter FindFilesFilter) ([]File, error)

FindFiles returns a list of files in the paths. If the filter is nil, it returns any files.

func (*FileSystem) ReadAsBase64EncodedContent

func (fs *FileSystem) ReadAsBase64EncodedContent(filename string) (string, error)

ReadAsBase64EncodedContent returns content of the file as base64 encoded string.

type FindFilesFilter

type FindFilesFilter interface {
	SkipDir(path string) bool     // If true, it skips entering the directory
	ExcludeFile(path string) bool // If true, it excludes the file from the result
}

FindFilesFilter is an interface to filter directories and files.

type Interface

type Interface interface {
	FindFiles(paths []string, filter FindFilesFilter) ([]File, error)
	ReadAsBase64EncodedContent(filename string) (string, error)
}

Directories

Path Synopsis
Package mock_fs is a generated GoMock package.
Package mock_fs is a generated GoMock package.

Jump to

Keyboard shortcuts

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