Package wkfs
Package wkfs implements the pluggable "well-known filesystem" abstraction layer.
Instead of accessing files directly through the operating system
using os.Open or os.Stat, code should use wkfs.Open or wkfs.Stat,
which first try to intercept paths at well-known top-level
directories representing previously-registered mount types,
otherwise fall through to the operating system paths.
Example of top-level well-known directories that might be
registered include /gcs/bucket/object for Google Cloud Storage or
/s3/bucket/object for AWS S3.
- func Lstat(name string) (os.FileInfo, error)
- func MkdirAll(path string, perm os.FileMode) error
- func ReadFile(filename string) ([]byte, error)
- func RegisterFS(prefix string, fs FileSystem)
- func Remove(name string) error
- func Stat(name string) (os.FileInfo, error)
- func WriteFile(filename string, data []byte, perm os.FileMode) error
- type File
- func Open(name string) (File, error)
- type FileSystem
- type FileWriter
- func Create(name string) (FileWriter, error)
- func OpenFile(name string, flag int, perm os.FileMode) (FileWriter, error)
Package files
wkfs.go
In the call graph viewer below, each node
is a function belonging to this package
and its children are the functions it
calls—perhaps dynamically.
The root nodes are the entry points of the
package: functions that may be called from
outside the package.
There may be non-exported or anonymous
functions among them if they are called
dynamically from another package.
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring func
token.
Functions may be omitted if they were
determined to be unreachable in the
particular programs or tests that were
analyzed.
func Lstat(name string) (os.FileInfo, error)
func MkdirAll(path string, perm os.FileMode) error
func ReadFile(filename string) ([]byte, error)
func RegisterFS(prefix string, fs FileSystem)
RegisterFS registers a well-known filesystem. It intercepts
anything beginning with prefix (which must start and end with a
forward slash) and forwards it to fs.
func Remove(name string) error
func Stat(name string) (os.FileInfo, error)
func WriteFile(filename string, data []byte, perm os.FileMode) error
WriteFile writes data to a file named by filename.
If the file does not exist, WriteFile creates it with permissions perm;
otherwise WriteFile truncates it before writing.
type File interface {
io.Reader
io.ReaderAt
io.Closer
io.Seeker
Name() string
Stat() (os.FileInfo, error)
}
func Open(name string) (File, error)
type FileSystem interface {
Open(name string) (File, error)
OpenFile(name string, flag int, perm os.FileMode) (FileWriter, error)
Stat(name string) (os.FileInfo, error)
Lstat(name string) (os.FileInfo, error)
MkdirAll(path string, perm os.FileMode) error
Remove(name string) error
}
type FileWriter interface {
io.Writer
io.Closer
}
func Create(name string) (FileWriter, error)
func OpenFile(name string, flag int, perm os.FileMode) (FileWriter, error)
Subdirectories
Name |
Synopsis |
.. |
gcs
|
Package gcs registers a Google Cloud Storage filesystem at the well-known /gcs/ filesystem path if the current machine is running on Google Compute Engine.
|