Documentation ¶
Index ¶
- type BasicMock
- func (fs *BasicMock) Create(filename string) (billy.File, error)
- func (fs *BasicMock) Join(elem ...string) string
- func (fs *BasicMock) Open(filename string) (billy.File, error)
- func (fs *BasicMock) OpenFile(filename string, flag int, mode os.FileMode) (billy.File, error)
- func (fs *BasicMock) Remove(filename string) error
- func (fs *BasicMock) Rename(target, link string) error
- func (fs *BasicMock) Stat(filename string) (os.FileInfo, error)
- type BasicSuite
- func (s *BasicSuite) TestCreate(c *C)
- func (s *BasicSuite) TestCreateAndClose(c *C)
- func (s *BasicSuite) TestCreateDepth(c *C)
- func (s *BasicSuite) TestCreateDepthAbsolute(c *C)
- func (s *BasicSuite) TestCreateOverwrite(c *C)
- func (s *BasicSuite) TestFileCloseTwice(c *C)
- func (s *BasicSuite) TestFileClosed(c *C)
- func (s *BasicSuite) TestFileNonRead(c *C)
- func (s *BasicSuite) TestFileRead(c *C)
- func (s *BasicSuite) TestFileSeekClosed(c *C)
- func (s *BasicSuite) TestFileSeekCurrent(c *C)
- func (s *BasicSuite) TestFileSeekEnd(c *C)
- func (s *BasicSuite) TestFileSeekstart(c *C)
- func (s *BasicSuite) TestFileWrite(c *C)
- func (s *BasicSuite) TestFileWriteClose(c *C)
- func (s *BasicSuite) TestJoin(c *C)
- func (s *BasicSuite) TestOpen(c *C)
- func (s *BasicSuite) TestOpenAndStat(c *C)
- func (s *BasicSuite) TestOpenAndWrite(c *C)
- func (s *BasicSuite) TestOpenFile(c *C)
- func (s *BasicSuite) TestOpenFileAppend(c *C)
- func (s *BasicSuite) TestOpenFileNoTruncate(c *C)
- func (s *BasicSuite) TestOpenFileReadWrite(c *C)
- func (s *BasicSuite) TestOpenFileWithModes(c *C)
- func (s *BasicSuite) TestOpenNotExists(c *C)
- func (s *BasicSuite) TestReadAtEOF(c *C)
- func (s *BasicSuite) TestReadAtOffset(c *C)
- func (s *BasicSuite) TestReadAtOnReadOnly(c *C)
- func (s *BasicSuite) TestReadAtOnReadWrite(c *C)
- func (s *BasicSuite) TestReadWriteLargeFile(c *C)
- func (s *BasicSuite) TestRemove(c *C)
- func (s *BasicSuite) TestRemoveNonExisting(c *C)
- func (s *BasicSuite) TestRemoveNotEmptyDir(c *C)
- func (s *BasicSuite) TestRename(c *C)
- func (s *BasicSuite) TestSeekToEndAndWrite(c *C)
- func (s *BasicSuite) TestStat(c *C)
- func (s *BasicSuite) TestStatDeep(c *C)
- func (s *BasicSuite) TestStatNonExistent(c *C)
- func (s *BasicSuite) TestTruncate(c *C)
- func (s *BasicSuite) TestWriteFile(c *C)
- type ChrootSuite
- func (s *ChrootSuite) TestCreateWithChroot(c *C)
- func (s *ChrootSuite) TestOpenOutOffBoundary(c *C)
- func (s *ChrootSuite) TestOpenWithChroot(c *C)
- func (s *ChrootSuite) TestReadDirWithChroot(c *C)
- func (s *ChrootSuite) TestRemoveOutOffBoundary(c *C)
- func (s *ChrootSuite) TestRenameOutOffBoundary(c *C)
- func (s *ChrootSuite) TestStatOutOffBoundary(c *C)
- func (s *ChrootSuite) TestStatWithChroot(c *C)
- type DirMock
- type DirSuite
- func (s *DirSuite) TestMkdirAll(c *C)
- func (s *DirSuite) TestMkdirAllAndCreate(c *C)
- func (s *DirSuite) TestMkdirAllIdempotent(c *C)
- func (s *DirSuite) TestMkdirAllNested(c *C)
- func (s *DirSuite) TestMkdirAllWithExistingFile(c *C)
- func (s *DirSuite) TestReadDir(c *C)
- func (s *DirSuite) TestReadDirFileInfo(c *C)
- func (s *DirSuite) TestReadDirFileInfoDirs(c *C)
- func (s *DirSuite) TestReadDirNested(c *C)
- func (s *DirSuite) TestReadDirWithMkDirAll(c *C)
- func (s *DirSuite) TestRenameDir(c *C)
- func (s *DirSuite) TestRenameToDir(c *C)
- func (s *DirSuite) TestStatDir(c *C)
- type FileMock
- type FilesystemSuite
- func (s *FilesystemSuite) TestCreateWithExistantDir(c *C)
- func (s *FilesystemSuite) TestReadDir(c *C)
- func (s *FilesystemSuite) TestReadDirWithLink(c *C)
- func (s *FilesystemSuite) TestRemoveAll(c *C)
- func (s *FilesystemSuite) TestRemoveAllEmptyDir(c *C)
- func (s *FilesystemSuite) TestRemoveAllNonExistent(c *C)
- func (s *FilesystemSuite) TestRemoveAllRelative(c *C)
- func (s *FilesystemSuite) TestRoot(c *C)
- func (s *FilesystemSuite) TestSymlinkReadDir(c *C)
- func (s *FilesystemSuite) TestSymlinkToDir(c *C)
- func (s *FilesystemSuite) TestSymlinkWithChrootBasic(c *C)
- func (s *FilesystemSuite) TestSymlinkWithChrootCrossBounders(c *C)
- type NoLockCapFs
- type OnlyReadCapFs
- type SymlinkMock
- type SymlinkSuite
- func (s *SymlinkSuite) TestLstat(c *C)
- func (s *SymlinkSuite) TestLstatLink(c *C)
- func (s *SymlinkSuite) TestOpenWithSymlinkToAbsolutePath(c *C)
- func (s *SymlinkSuite) TestOpenWithSymlinkToRelativePath(c *C)
- func (s *SymlinkSuite) TestReadlink(c *C)
- func (s *SymlinkSuite) TestReadlinkWithAbsolutePath(c *C)
- func (s *SymlinkSuite) TestReadlinkWithNonExistentLink(c *C)
- func (s *SymlinkSuite) TestReadlinkWithNonExistentTarget(c *C)
- func (s *SymlinkSuite) TestReadlinkWithRelativePath(c *C)
- func (s *SymlinkSuite) TestRemoveWithSymlink(c *C)
- func (s *SymlinkSuite) TestRenameWithSymlink(c *C)
- func (s *SymlinkSuite) TestStatLink(c *C)
- func (s *SymlinkSuite) TestSymlink(c *C)
- func (s *SymlinkSuite) TestSymlinkCrossDirs(c *C)
- func (s *SymlinkSuite) TestSymlinkNested(c *C)
- func (s *SymlinkSuite) TestSymlinkWithExistingLink(c *C)
- func (s *SymlinkSuite) TestSymlinkWithNonExistentdTarget(c *C)
- type TempFileMock
- type TempFileSuite
- func (s *TempFileSuite) TestRemoveTempFile(c *C)
- func (s *TempFileSuite) TestRenameTempFile(c *C)
- func (s *TempFileSuite) TestTempFile(c *C)
- func (s *TempFileSuite) TestTempFileFullWithPath(c *C)
- func (s *TempFileSuite) TestTempFileMany(c *C)
- func (s *TempFileSuite) TestTempFileManyWithUtil(c *C)
- func (s *TempFileSuite) TestTempFileWithPath(c *C)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicMock ¶
type BasicMock struct { CreateArgs []string OpenArgs []string OpenFileArgs [][3]interface{} StatArgs []string RenameArgs [][2]string RemoveArgs []string JoinArgs [][]string }
type BasicSuite ¶
type BasicSuite struct {
FS Basic
}
BasicSuite is a convenient test suite to validate any implementation of billy.Basic
func (*BasicSuite) TestCreate ¶
func (s *BasicSuite) TestCreate(c *C)
func (*BasicSuite) TestCreateAndClose ¶
func (s *BasicSuite) TestCreateAndClose(c *C)
func (*BasicSuite) TestCreateDepth ¶
func (s *BasicSuite) TestCreateDepth(c *C)
func (*BasicSuite) TestCreateDepthAbsolute ¶
func (s *BasicSuite) TestCreateDepthAbsolute(c *C)
func (*BasicSuite) TestCreateOverwrite ¶
func (s *BasicSuite) TestCreateOverwrite(c *C)
func (*BasicSuite) TestFileCloseTwice ¶
func (s *BasicSuite) TestFileCloseTwice(c *C)
func (*BasicSuite) TestFileClosed ¶
func (s *BasicSuite) TestFileClosed(c *C)
func (*BasicSuite) TestFileNonRead ¶
func (s *BasicSuite) TestFileNonRead(c *C)
func (*BasicSuite) TestFileRead ¶
func (s *BasicSuite) TestFileRead(c *C)
func (*BasicSuite) TestFileSeekClosed ¶
func (s *BasicSuite) TestFileSeekClosed(c *C)
func (*BasicSuite) TestFileSeekCurrent ¶
func (s *BasicSuite) TestFileSeekCurrent(c *C)
func (*BasicSuite) TestFileSeekEnd ¶
func (s *BasicSuite) TestFileSeekEnd(c *C)
func (*BasicSuite) TestFileSeekstart ¶
func (s *BasicSuite) TestFileSeekstart(c *C)
func (*BasicSuite) TestFileWrite ¶
func (s *BasicSuite) TestFileWrite(c *C)
func (*BasicSuite) TestFileWriteClose ¶
func (s *BasicSuite) TestFileWriteClose(c *C)
func (*BasicSuite) TestJoin ¶
func (s *BasicSuite) TestJoin(c *C)
func (*BasicSuite) TestOpen ¶
func (s *BasicSuite) TestOpen(c *C)
func (*BasicSuite) TestOpenAndStat ¶
func (s *BasicSuite) TestOpenAndStat(c *C)
func (*BasicSuite) TestOpenAndWrite ¶
func (s *BasicSuite) TestOpenAndWrite(c *C)
func (*BasicSuite) TestOpenFile ¶
func (s *BasicSuite) TestOpenFile(c *C)
func (*BasicSuite) TestOpenFileAppend ¶
func (s *BasicSuite) TestOpenFileAppend(c *C)
func (*BasicSuite) TestOpenFileNoTruncate ¶
func (s *BasicSuite) TestOpenFileNoTruncate(c *C)
func (*BasicSuite) TestOpenFileReadWrite ¶
func (s *BasicSuite) TestOpenFileReadWrite(c *C)
func (*BasicSuite) TestOpenFileWithModes ¶
func (s *BasicSuite) TestOpenFileWithModes(c *C)
func (*BasicSuite) TestOpenNotExists ¶
func (s *BasicSuite) TestOpenNotExists(c *C)
func (*BasicSuite) TestReadAtEOF ¶
func (s *BasicSuite) TestReadAtEOF(c *C)
func (*BasicSuite) TestReadAtOffset ¶
func (s *BasicSuite) TestReadAtOffset(c *C)
func (*BasicSuite) TestReadAtOnReadOnly ¶
func (s *BasicSuite) TestReadAtOnReadOnly(c *C)
func (*BasicSuite) TestReadAtOnReadWrite ¶
func (s *BasicSuite) TestReadAtOnReadWrite(c *C)
func (*BasicSuite) TestReadWriteLargeFile ¶
func (s *BasicSuite) TestReadWriteLargeFile(c *C)
func (*BasicSuite) TestRemove ¶
func (s *BasicSuite) TestRemove(c *C)
func (*BasicSuite) TestRemoveNonExisting ¶
func (s *BasicSuite) TestRemoveNonExisting(c *C)
func (*BasicSuite) TestRemoveNotEmptyDir ¶
func (s *BasicSuite) TestRemoveNotEmptyDir(c *C)
func (*BasicSuite) TestRename ¶
func (s *BasicSuite) TestRename(c *C)
func (*BasicSuite) TestSeekToEndAndWrite ¶
func (s *BasicSuite) TestSeekToEndAndWrite(c *C)
func (*BasicSuite) TestStat ¶
func (s *BasicSuite) TestStat(c *C)
func (*BasicSuite) TestStatDeep ¶
func (s *BasicSuite) TestStatDeep(c *C)
func (*BasicSuite) TestStatNonExistent ¶
func (s *BasicSuite) TestStatNonExistent(c *C)
func (*BasicSuite) TestTruncate ¶
func (s *BasicSuite) TestTruncate(c *C)
func (*BasicSuite) TestWriteFile ¶
func (s *BasicSuite) TestWriteFile(c *C)
type ChrootSuite ¶
type ChrootSuite struct {
FS interface {
Basic
Chroot
}
}
ChrootSuite is a convenient test suite to validate any implementation of billy.Chroot
func (*ChrootSuite) TestCreateWithChroot ¶
func (s *ChrootSuite) TestCreateWithChroot(c *C)
func (*ChrootSuite) TestOpenOutOffBoundary ¶
func (s *ChrootSuite) TestOpenOutOffBoundary(c *C)
func (*ChrootSuite) TestOpenWithChroot ¶
func (s *ChrootSuite) TestOpenWithChroot(c *C)
func (*ChrootSuite) TestReadDirWithChroot ¶
func (s *ChrootSuite) TestReadDirWithChroot(c *C)
func (*ChrootSuite) TestRemoveOutOffBoundary ¶
func (s *ChrootSuite) TestRemoveOutOffBoundary(c *C)
func (*ChrootSuite) TestRenameOutOffBoundary ¶
func (s *ChrootSuite) TestRenameOutOffBoundary(c *C)
func (*ChrootSuite) TestStatOutOffBoundary ¶
func (s *ChrootSuite) TestStatOutOffBoundary(c *C)
func (*ChrootSuite) TestStatWithChroot ¶
func (s *ChrootSuite) TestStatWithChroot(c *C)
type DirSuite ¶
type DirSuite struct {
FS interface {
Basic
Dir
}
}
DirSuite is a convenient test suite to validate any implementation of billy.Dir
func (*DirSuite) TestMkdirAll ¶
func (s *DirSuite) TestMkdirAll(c *C)
func (*DirSuite) TestMkdirAllAndCreate ¶
func (s *DirSuite) TestMkdirAllAndCreate(c *C)
func (*DirSuite) TestMkdirAllIdempotent ¶
func (s *DirSuite) TestMkdirAllIdempotent(c *C)
func (*DirSuite) TestMkdirAllNested ¶
func (s *DirSuite) TestMkdirAllNested(c *C)
func (*DirSuite) TestMkdirAllWithExistingFile ¶
func (s *DirSuite) TestMkdirAllWithExistingFile(c *C)
func (*DirSuite) TestReadDir ¶
func (s *DirSuite) TestReadDir(c *C)
func (*DirSuite) TestReadDirFileInfo ¶
func (s *DirSuite) TestReadDirFileInfo(c *C)
func (*DirSuite) TestReadDirFileInfoDirs ¶
func (s *DirSuite) TestReadDirFileInfoDirs(c *C)
func (*DirSuite) TestReadDirNested ¶
func (s *DirSuite) TestReadDirNested(c *C)
func (*DirSuite) TestReadDirWithMkDirAll ¶
func (s *DirSuite) TestReadDirWithMkDirAll(c *C)
func (*DirSuite) TestRenameDir ¶
func (s *DirSuite) TestRenameDir(c *C)
func (*DirSuite) TestRenameToDir ¶
func (s *DirSuite) TestRenameToDir(c *C)
func (*DirSuite) TestStatDir ¶
func (s *DirSuite) TestStatDir(c *C)
type FilesystemSuite ¶
type FilesystemSuite struct { FS Filesystem BasicSuite DirSuite SymlinkSuite TempFileSuite ChrootSuite }
FilesystemSuite is a convenient test suite to validate any implementation of billy.Filesystem
func NewFilesystemSuite ¶
func NewFilesystemSuite(fs Filesystem) FilesystemSuite
NewFilesystemSuite returns a new FilesystemSuite based on the given fs.
func (*FilesystemSuite) TestCreateWithExistantDir ¶
func (s *FilesystemSuite) TestCreateWithExistantDir(c *C)
func (*FilesystemSuite) TestReadDir ¶
func (s *FilesystemSuite) TestReadDir(c *C)
func (*FilesystemSuite) TestReadDirWithLink ¶
func (s *FilesystemSuite) TestReadDirWithLink(c *C)
func (*FilesystemSuite) TestRemoveAll ¶
func (s *FilesystemSuite) TestRemoveAll(c *C)
func (*FilesystemSuite) TestRemoveAllEmptyDir ¶
func (s *FilesystemSuite) TestRemoveAllEmptyDir(c *C)
func (*FilesystemSuite) TestRemoveAllNonExistent ¶
func (s *FilesystemSuite) TestRemoveAllNonExistent(c *C)
func (*FilesystemSuite) TestRemoveAllRelative ¶
func (s *FilesystemSuite) TestRemoveAllRelative(c *C)
func (*FilesystemSuite) TestRoot ¶
func (s *FilesystemSuite) TestRoot(c *C)
func (*FilesystemSuite) TestSymlinkReadDir ¶
func (s *FilesystemSuite) TestSymlinkReadDir(c *C)
func (*FilesystemSuite) TestSymlinkToDir ¶
func (s *FilesystemSuite) TestSymlinkToDir(c *C)
func (*FilesystemSuite) TestSymlinkWithChrootBasic ¶
func (s *FilesystemSuite) TestSymlinkWithChrootBasic(c *C)
func (*FilesystemSuite) TestSymlinkWithChrootCrossBounders ¶
func (s *FilesystemSuite) TestSymlinkWithChrootCrossBounders(c *C)
type NoLockCapFs ¶
type NoLockCapFs struct {
BasicMock
}
func (*NoLockCapFs) Capabilities ¶
func (o *NoLockCapFs) Capabilities() billy.Capability
type OnlyReadCapFs ¶
type OnlyReadCapFs struct {
BasicMock
}
func (*OnlyReadCapFs) Capabilities ¶
func (o *OnlyReadCapFs) Capabilities() billy.Capability
type SymlinkMock ¶
type SymlinkMock struct { BasicMock LstatArgs []string SymlinkArgs [][2]string ReadlinkArgs []string }
func (*SymlinkMock) Symlink ¶
func (fs *SymlinkMock) Symlink(target, link string) error
type SymlinkSuite ¶
type SymlinkSuite struct {
FS interface {
Basic
Symlink
}
}
SymlinkSuite is a convenient test suite to validate any implementation of billy.Symlink
func (*SymlinkSuite) TestLstat ¶
func (s *SymlinkSuite) TestLstat(c *C)
func (*SymlinkSuite) TestLstatLink ¶
func (s *SymlinkSuite) TestLstatLink(c *C)
func (*SymlinkSuite) TestOpenWithSymlinkToAbsolutePath ¶
func (s *SymlinkSuite) TestOpenWithSymlinkToAbsolutePath(c *C)
func (*SymlinkSuite) TestOpenWithSymlinkToRelativePath ¶
func (s *SymlinkSuite) TestOpenWithSymlinkToRelativePath(c *C)
func (*SymlinkSuite) TestReadlink ¶
func (s *SymlinkSuite) TestReadlink(c *C)
func (*SymlinkSuite) TestReadlinkWithAbsolutePath ¶
func (s *SymlinkSuite) TestReadlinkWithAbsolutePath(c *C)
func (*SymlinkSuite) TestReadlinkWithNonExistentLink ¶
func (s *SymlinkSuite) TestReadlinkWithNonExistentLink(c *C)
func (*SymlinkSuite) TestReadlinkWithNonExistentTarget ¶
func (s *SymlinkSuite) TestReadlinkWithNonExistentTarget(c *C)
func (*SymlinkSuite) TestReadlinkWithRelativePath ¶
func (s *SymlinkSuite) TestReadlinkWithRelativePath(c *C)
func (*SymlinkSuite) TestRemoveWithSymlink ¶
func (s *SymlinkSuite) TestRemoveWithSymlink(c *C)
func (*SymlinkSuite) TestRenameWithSymlink ¶
func (s *SymlinkSuite) TestRenameWithSymlink(c *C)
func (*SymlinkSuite) TestStatLink ¶
func (s *SymlinkSuite) TestStatLink(c *C)
func (*SymlinkSuite) TestSymlink ¶
func (s *SymlinkSuite) TestSymlink(c *C)
func (*SymlinkSuite) TestSymlinkCrossDirs ¶
func (s *SymlinkSuite) TestSymlinkCrossDirs(c *C)
func (*SymlinkSuite) TestSymlinkNested ¶
func (s *SymlinkSuite) TestSymlinkNested(c *C)
func (*SymlinkSuite) TestSymlinkWithExistingLink ¶
func (s *SymlinkSuite) TestSymlinkWithExistingLink(c *C)
func (*SymlinkSuite) TestSymlinkWithNonExistentdTarget ¶
func (s *SymlinkSuite) TestSymlinkWithNonExistentdTarget(c *C)
type TempFileMock ¶
func (*TempFileMock) TempFile ¶
func (fs *TempFileMock) TempFile(dir, prefix string) (billy.File, error)
type TempFileSuite ¶
type TempFileSuite struct {
FS interface {
billy.Basic
billy.TempFile
}
}
TempFileSuite is a convenient test suite to validate any implementation of billy.TempFile
func (*TempFileSuite) TestRemoveTempFile ¶
func (s *TempFileSuite) TestRemoveTempFile(c *C)
func (*TempFileSuite) TestRenameTempFile ¶
func (s *TempFileSuite) TestRenameTempFile(c *C)
func (*TempFileSuite) TestTempFile ¶
func (s *TempFileSuite) TestTempFile(c *C)
func (*TempFileSuite) TestTempFileFullWithPath ¶
func (s *TempFileSuite) TestTempFileFullWithPath(c *C)
func (*TempFileSuite) TestTempFileMany ¶
func (s *TempFileSuite) TestTempFileMany(c *C)
func (*TempFileSuite) TestTempFileManyWithUtil ¶
func (s *TempFileSuite) TestTempFileManyWithUtil(c *C)
func (*TempFileSuite) TestTempFileWithPath ¶
func (s *TempFileSuite) TestTempFileWithPath(c *C)
Click to show internal directories.
Click to hide internal directories.