Documentation ¶
Overview ¶
Package filemanager implement interfaces to run install-script tests
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileManager ¶ added in v0.52.0
type FileManager interface { ReadFile(path string) ([]byte, error) ReadDir(path string) ([]fs.DirEntry, error) FileExists(path string) (bool, error) WriteFile(path string, content []byte) (int64, error) }
FileManager generic interface
type RemoteHost ¶ added in v0.52.0
type RemoteHost struct {
// contains filtered or unexported fields
}
RemoteHost implement filemanager interface using components.RemoteHost
func NewRemoteHost ¶ added in v0.52.0
func NewRemoteHost(host *components.RemoteHost) *RemoteHost
NewRemoteHost create a new file manager using components.RemoteHost Note: The file operations will be restricted to the permissions of the client connection user
func (*RemoteHost) FileExists ¶ added in v0.52.0
func (u *RemoteHost) FileExists(path string) (bool, error)
FileExists check if the file exists, return an error if it does not
func (*RemoteHost) ReadDir ¶ added in v0.52.0
func (u *RemoteHost) ReadDir(path string) ([]fs.DirEntry, error)
ReadDir returns list of directory entries in path
type Unix ¶
type Unix struct {
// contains filtered or unexported fields
}
Unix implement filemanager interface for Unix distributions
func NewUnix ¶ added in v0.52.0
func NewUnix(host *components.RemoteHost) *Unix
NewUnix create a new unix file manager
func (*Unix) FileExists ¶
FileExists check if the file exists, return an error if it does not
func (*Unix) ReadDir ¶ added in v0.52.0
ReadDir only returns the Name of files in path, not stat modes TODO: Return a real DirEntry