Documentation ¶
Index ¶
- type OsFs
- func (o *OsFs) Chmod(filePath string, mode os.FileMode) error
- func (o *OsFs) Create(path string) (afero.File, error)
- func (o *OsFs) DownloadFile(ctx context.Context, filepath, url string, ...) error
- func (o *OsFs) MkdirAll(path string, perm os.FileMode) error
- func (o *OsFs) Open(path string) (afero.File, error)
- func (o *OsFs) Remove(filePath string) error
- func (o *OsFs) SetFSInstance(fs afero.Fs)
- func (o *OsFs) Stat(path string) (os.FileInfo, error)
- func (o *OsFs) WalkPathTree(path string, walker func(path string, info os.FileInfo, err error) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OsFs ¶
type OsFs struct {
// contains filtered or unexported fields
}
OsFs is the struct that defines the os filesystem singleton instance.
func (*OsFs) Chmod ¶
Chmod is a wrapper around afero.Chmod that changes the file/folder permissions.
func (*OsFs) DownloadFile ¶
func (o *OsFs) DownloadFile(ctx context.Context, filepath, url string, progressUpdater ui.ProgressUpdateFunc) error
DownloadFile will download url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory. We pass an io.TeeReader into Copy() to report progress on the download.
func (*OsFs) MkdirAll ¶
MkdirAll is a wrapper around afero.Mkdirall that creates the full path directory tree.
func (*OsFs) SetFSInstance ¶
SetFSInstance sets the FS instance. Should be only used for testing purpose.
Click to show internal directories.
Click to hide internal directories.