Documentation
¶
Index ¶
- func Search(pattern string, path string, o *SearchOptions) (string, error)
- type FileInfo
- type FileStat
- type FileStore
- type FileSystem
- type LocalFS
- func (s *LocalFS) CreateDirectory(path string) error
- func (s *LocalFS) FileInfo(path string) (*FileInfo, error)
- func (s *LocalFS) ListDirectory(path string) ([]string, error)
- func (s *LocalFS) Locator(path string) (string, error)
- func (s *LocalFS) Lstat(name string) (fs.FileInfo, error)
- func (s *LocalFS) OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error)
- func (s *LocalFS) ReadDir(name string) ([]fs.DirEntry, error)
- func (s *LocalFS) ReadFile(path string) ([]byte, error)
- func (s *LocalFS) RenameFile(source, destination string) error
- func (s *LocalFS) SearchFiles(pattern string, path string, options *SearchOptions) (string, error)
- func (s *LocalFS) Stat(name string) (fs.FileInfo, error)
- func (s *LocalFS) WriteFile(path string, content []byte) error
- type SearchOptions
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileInfo ¶
type FileInfo struct {
Filename string `json:"filename"`
IsDirectory bool `json:"isDirectory"`
IsFile bool `json:"isFile"`
IsLink bool `json:"isLink"`
Permissions string `json:"permissions"`
Length int64 `json:"size"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
Accessed time.Time `json:"accessed"`
// original info for local fs
Info fs.FileInfo `json:"-"`
}
type FileSystem ¶
type FileSystem interface {
FileStore
ListDirectory(string) ([]string, error)
CreateDirectory(string) error
RenameFile(string, string) error
FileInfo(string) (*FileInfo, error)
// EditFile
SearchFiles(pattern string, path string, options *SearchOptions) (string, error)
}
FileSystem is a virtual file system that provides a set of operations to interact with the file system in a controlled manner.
type LocalFS ¶
type LocalFS struct {
}
Local fs is a workspace
func (*LocalFS) CreateDirectory ¶
func (*LocalFS) RenameFile ¶
func (*LocalFS) SearchFiles ¶
type SearchOptions ¶
type SearchOptions struct {
// Parse PATTERN as a regular expression
// Accepted syntax is the same
// as https://github.com/google/re2/wiki/Syntax
Regexp bool
// Match case insensitively
IgnoreCase bool
// Only match whole words
WordRegexp bool
// Ignore files/directories matching pattern
Exclude []string
// Limit search to filenames matching PATTERN
FileSearchRegexp string
// Search up to 'Depth' directories deep (default: 25)
Depth int
// Follow symlinks
Follow bool
// Search hidden files and directories
Hidden bool
}
Click to show internal directories.
Click to hide internal directories.