testutil

package
v0.0.0-...-81c1a03 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestSFTPClient

func NewTestSFTPClient() (*sftp.Client, func(), error)

NewTestSFTPClient creates a new client that is connected to a server that operates on the host file system. Call the returned function to clean up after use.

Types

type FakeFileInfo

type FakeFileInfo struct {
	os.FileInfo
}

func (*FakeFileInfo) IsDir

func (fi *FakeFileInfo) IsDir() bool

func (*FakeFileInfo) Name

func (fi *FakeFileInfo) Name() string

type FakeSFTPClient

type FakeSFTPClient struct {
	Root string

	NClosed int
	NCalls  map[string]int
}

func NewFakeSFTPClient

func NewFakeSFTPClient(root string) *FakeSFTPClient

func (*FakeSFTPClient) Chmod

func (c *FakeSFTPClient) Chmod(path string, mode os.FileMode) error

func (*FakeSFTPClient) Chown

func (c *FakeSFTPClient) Chown(path string, uid, gid int) error

func (*FakeSFTPClient) Chtimes

func (c *FakeSFTPClient) Chtimes(path string, atime time.Time, mtime time.Time) error

func (*FakeSFTPClient) Close

func (c *FakeSFTPClient) Close() error

func (*FakeSFTPClient) Create

func (c *FakeSFTPClient) Create(path string) (*sftp.File, error)
func (c *FakeSFTPClient) Link(oldname, newname string) error

func (*FakeSFTPClient) Lstat

func (c *FakeSFTPClient) Lstat(path string) (os.FileInfo, error)

func (*FakeSFTPClient) Mkdir

func (c *FakeSFTPClient) Mkdir(path string) error

func (*FakeSFTPClient) Open

func (c *FakeSFTPClient) Open(path string) (*sftp.File, error)

func (*FakeSFTPClient) PosixRename

func (c *FakeSFTPClient) PosixRename(oldname, newname string) error

func (*FakeSFTPClient) ReadDir

func (c *FakeSFTPClient) ReadDir(path string) ([]os.FileInfo, error)
func (c *FakeSFTPClient) ReadLink(path string) (string, error)

func (*FakeSFTPClient) Remove

func (c *FakeSFTPClient) Remove(path string) error

func (*FakeSFTPClient) RemoveDirectory

func (c *FakeSFTPClient) RemoveDirectory(path string) error

func (*FakeSFTPClient) StatVFS

func (c *FakeSFTPClient) StatVFS(path string) (*sftp.StatVFS, error)
func (c *FakeSFTPClient) Symlink(oldname, newname string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL