Documentation ¶
Overview ¶
Package fs provides a primitive virtual file system.
Index ¶
- func Content(path string) ([]byte, error)
- func FindASN1Files(dir string) []string
- func FindCFiles(dir string) []string
- func FindFilesRecursive(dir string) []string
- func FindK3EnvInCurrPath(dir string) string
- func FindTTCN3DirectoriesRecursive(dir string) []string
- func FindTTCN3Files(dir string) []string
- func FindTTCN3FilesRecursive(dir string) []string
- func Glob(s string) []string
- func HasASN1Extension(file string) bool
- func HasCExtension(file string) bool
- func HasTTCN3Extension(file string) bool
- func IsDir(path string) bool
- func IsFsRoot(path string) bool
- func IsRegular(path string) bool
- func Path(s string) string
- func PathSlice(files ...*File) []string
- func Real(base, path string) string
- func Rel(base string, paths ...string) []string
- func SetContent(path string, b []byte)
- func Slugify(s string) string
- func Stem(s string) string
- func TTCN3Files(paths ...string) ([]string, error)
- func URI(path string) span.URI
- func WalkUp(path string, f func(path string) bool)
- type File
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindASN1Files ¶
FindASN1Files returns a list of ASN.1 files (.asn, asn1).
func FindCFiles ¶
FindCFiles returns a list of C/C++ files (.c, .cc, .cxx, .cpp).
func FindFilesRecursive ¶ added in v0.9.1
FindFilesRecursive returns a list files from the whole directory subtree.
func FindK3EnvInCurrPath ¶ added in v0.9.1
FindK3EnvInCurrPath returns the path of the directory containing k3.env
func FindTTCN3DirectoriesRecursive ¶ added in v0.9.2
FindTTCN3DirectoriesRecursive returns a list of directories containing TTCN-3 source files.
func FindTTCN3Files ¶
FindTTCN3Files returns a list of TTCN-3 source files (.ttcn3, .ttcn).
func FindTTCN3FilesRecursive ¶ added in v0.9.2
FindTTCN3FilesRecursive returns a list TTCN-3 source files available in directory sub-tree.
func HasASN1Extension ¶
HasASN1Extension returns true if file has suffix .asn or .asn1
func HasCExtension ¶
HasCExtension returns true if file has suffix .c, .cc, .cxx or .cpp
func HasTTCN3Extension ¶
HasTTCN3Extension returns true if file has suffix .ttcn3 or .ttcn
func IsFsRoot ¶ added in v0.9.3
IsFsRoot returns true if the supplied path coincides with the filesystem root
func Path ¶ added in v0.9.1
Path returns a decoded file path when you pass a URI with file:// scheme.
func Rel ¶ added in v0.9.1
Rel makes paths relative to base, when not absolute already. Use it when when you want to make a path relative to a test suite manifest.
func SetContent ¶ added in v0.9.1
SetContent of (virtual) file specified by path.
func TTCN3Files ¶ added in v0.9.2
TTCN3Files returns all TTCN3 files from input list.
Types ¶
type File ¶
type File struct { // We export the handle until we have better alternatives for cache invalidation. Handle *memoize.Handle // contains filtered or unexported fields }
A File represents a open file
func (*File) Bytes ¶
Bytes returns the contents of File. If content was not specified using SetBytes, Bytes will try reading the file path's content from disk.
func (*File) Reset ¶
func (f *File) Reset()
Reset sets the content to zero. This is identcal to SetBytes(nil)