testing

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextFs

type ContextFs struct {
	ChmodFunc     func(context.Context, string, fs.FileMode) error
	ChownFunc     func(context.Context, string, int, int) error
	ChtimesFunc   func(context.Context, string, time.Time, time.Time) error
	CreateFunc    func(context.Context, string) (afero.File, error)
	MkdirFunc     func(context.Context, string, fs.FileMode) error
	MkdirAllFunc  func(context.Context, string, fs.FileMode) error
	OpenFunc      func(context.Context, string) (afero.File, error)
	OpenFileFunc  func(context.Context, string, int, fs.FileMode) (afero.File, error)
	RemoveFunc    func(context.Context, string) error
	RemoveAllFunc func(context.Context, string) error
	RenameFunc    func(context.Context, string, string) error
	StatFunc      func(context.Context, string) (fs.FileInfo, error)
}

func (*ContextFs) Chmod

func (c *ContextFs) Chmod(ctx context.Context, name string, mode fs.FileMode) error

Chmod implements context.Fs.

func (*ContextFs) Chown

func (c *ContextFs) Chown(ctx context.Context, name string, uid int, gid int) error

Chown implements context.Fs.

func (*ContextFs) Chtimes

func (c *ContextFs) Chtimes(ctx context.Context, name string, atime time.Time, mtime time.Time) error

Chtimes implements context.Fs.

func (*ContextFs) Create

func (c *ContextFs) Create(ctx context.Context, name string) (afero.File, error)

Create implements context.Fs.

func (*ContextFs) Mkdir

func (c *ContextFs) Mkdir(ctx context.Context, name string, perm fs.FileMode) error

Mkdir implements context.Fs.

func (*ContextFs) MkdirAll

func (c *ContextFs) MkdirAll(ctx context.Context, path string, perm fs.FileMode) error

MkdirAll implements context.Fs.

func (*ContextFs) Name

func (c *ContextFs) Name() string

Name implements context.Fs.

func (*ContextFs) Open

func (c *ContextFs) Open(ctx context.Context, name string) (afero.File, error)

Open implements context.Fs.

func (*ContextFs) OpenFile

func (c *ContextFs) OpenFile(ctx context.Context, name string, flag int, perm fs.FileMode) (afero.File, error)

OpenFile implements context.Fs.

func (*ContextFs) Remove

func (c *ContextFs) Remove(ctx context.Context, name string) error

Remove implements context.Fs.

func (*ContextFs) RemoveAll

func (c *ContextFs) RemoveAll(ctx context.Context, path string) error

RemoveAll implements context.Fs.

func (*ContextFs) Rename

func (c *ContextFs) Rename(ctx context.Context, oldname string, newname string) error

Rename implements context.Fs.

func (*ContextFs) Stat

func (c *ContextFs) Stat(ctx context.Context, name string) (fs.FileInfo, error)

Stat implements context.Fs.

type ErrorFile added in v0.4.0

type ErrorFile struct {
	afero.File

	CloseErr        error
	ReadErr         error
	ReadAtErr       error
	ReaddirErr      error
	ReaddirnamesErr error
	SeekErr         error
	StatErr         error
	SyncErr         error
	TruncateErr     error
	WriteErr        error
	WriteAtErr      error
	WriteStringErr  error
}

func (*ErrorFile) Close added in v0.4.0

func (e *ErrorFile) Close() error

Close implements afero.File.

func (*ErrorFile) Read added in v0.4.0

func (e *ErrorFile) Read(p []byte) (n int, err error)

Read implements afero.File.

func (*ErrorFile) ReadAt added in v0.4.0

func (e *ErrorFile) ReadAt(p []byte, off int64) (n int, err error)

ReadAt implements afero.File.

func (*ErrorFile) Readdir added in v0.4.0

func (e *ErrorFile) Readdir(count int) ([]os.FileInfo, error)

Readdir implements afero.File.

func (*ErrorFile) Readdirnames added in v0.4.0

func (e *ErrorFile) Readdirnames(n int) ([]string, error)

Readdirnames implements afero.File.

func (*ErrorFile) Seek added in v0.4.0

func (e *ErrorFile) Seek(offset int64, whence int) (int64, error)

Seek implements afero.File.

func (*ErrorFile) Stat added in v0.4.0

func (e *ErrorFile) Stat() (os.FileInfo, error)

Stat implements afero.File.

func (*ErrorFile) Sync added in v0.4.0

func (e *ErrorFile) Sync() error

Sync implements afero.File.

func (*ErrorFile) Truncate added in v0.4.0

func (e *ErrorFile) Truncate(size int64) error

Truncate implements afero.File.

func (*ErrorFile) Write added in v0.4.0

func (e *ErrorFile) Write(p []byte) (n int, err error)

Write implements afero.File.

func (*ErrorFile) WriteAt added in v0.4.0

func (e *ErrorFile) WriteAt(p []byte, off int64) (n int, err error)

WriteAt implements afero.File.

func (*ErrorFile) WriteString added in v0.4.0

func (e *ErrorFile) WriteString(s string) (ret int, err error)

WriteString implements afero.File.

type ErrorFs added in v0.4.0

type ErrorFs struct {
	afero.Fs

	ChmodErr     error
	ChownErr     error
	ChtimesErr   error
	CreateErr    error
	MkdirErr     error
	MkdirAllErr  error
	OpenErr      error
	OpenFileErr  error
	RemoveErr    error
	RemoveAllErr error
	RenameErr    error
	StatErr      error
}

func (*ErrorFs) Chmod added in v0.4.0

func (f *ErrorFs) Chmod(name string, mode fs.FileMode) error

Chmod implements afero.Fs.

func (*ErrorFs) Chown added in v0.4.0

func (f *ErrorFs) Chown(name string, uid int, gid int) error

Chown implements afero.Fs.

func (*ErrorFs) Chtimes added in v0.4.0

func (f *ErrorFs) Chtimes(name string, atime time.Time, mtime time.Time) error

Chtimes implements afero.Fs.

func (*ErrorFs) Create added in v0.4.0

func (f *ErrorFs) Create(name string) (afero.File, error)

Create implements afero.Fs.

func (*ErrorFs) Mkdir added in v0.4.0

func (f *ErrorFs) Mkdir(name string, perm fs.FileMode) error

Mkdir implements afero.Fs.

func (*ErrorFs) MkdirAll added in v0.4.0

func (f *ErrorFs) MkdirAll(path string, perm fs.FileMode) error

MkdirAll implements afero.Fs.

func (*ErrorFs) Name added in v0.4.0

func (f *ErrorFs) Name() string

Name implements afero.Fs.

func (*ErrorFs) Open added in v0.4.0

func (f *ErrorFs) Open(name string) (afero.File, error)

Open implements afero.Fs.

func (*ErrorFs) OpenFile added in v0.4.0

func (f *ErrorFs) OpenFile(name string, flag int, perm fs.FileMode) (afero.File, error)

OpenFile implements afero.Fs.

func (*ErrorFs) Remove added in v0.4.0

func (f *ErrorFs) Remove(name string) error

Remove implements afero.Fs.

func (*ErrorFs) RemoveAll added in v0.4.0

func (f *ErrorFs) RemoveAll(path string) error

RemoveAll implements afero.Fs.

func (*ErrorFs) Rename added in v0.4.0

func (f *ErrorFs) Rename(oldname string, newname string) error

Rename implements afero.Fs.

func (*ErrorFs) Stat added in v0.4.0

func (f *ErrorFs) Stat(name string) (fs.FileInfo, error)

Stat implements afero.Fs.

type File

type File struct {
	CloseFunc        func() error
	NameFunc         func() string
	ReadFunc         func([]byte) (int, error)
	ReadAtFunc       func([]byte, int64) (int, error)
	ReaddirFunc      func(int) ([]fs.FileInfo, error)
	ReaddirnamesFunc func(int) ([]string, error)
	SeekFunc         func(int64, int) (int64, error)
	StatFunc         func() (fs.FileInfo, error)
	SyncFunc         func() error
	TruncateFunc     func(int64) error
	WriteFunc        func([]byte) (int, error)
	WriteAtFunc      func([]byte, int64) (int, error)
	WriteStringFunc  func(string) (int, error)
}

func (*File) Close

func (f *File) Close() error

Close implements afero.File.

func (*File) Name

func (f *File) Name() string

Name implements afero.File.

func (*File) Read

func (f *File) Read(p []byte) (n int, err error)

Read implements afero.File.

func (*File) ReadAt

func (f *File) ReadAt(p []byte, off int64) (n int, err error)

ReadAt implements afero.File.

func (*File) Readdir

func (f *File) Readdir(count int) ([]fs.FileInfo, error)

Readdir implements afero.File.

func (*File) Readdirnames

func (f *File) Readdirnames(n int) ([]string, error)

Readdirnames implements afero.File.

func (*File) Seek

func (f *File) Seek(offset int64, whence int) (int64, error)

Seek implements afero.File.

func (*File) Stat

func (f *File) Stat() (fs.FileInfo, error)

Stat implements afero.File.

func (*File) Sync

func (f *File) Sync() error

Sync implements afero.File.

func (*File) Truncate

func (f *File) Truncate(size int64) error

Truncate implements afero.File.

func (*File) Write

func (f *File) Write(p []byte) (n int, err error)

Write implements afero.File.

func (*File) WriteAt

func (f *File) WriteAt(p []byte, off int64) (n int, err error)

WriteAt implements afero.File.

func (*File) WriteString

func (f *File) WriteString(s string) (ret int, err error)

WriteString implements afero.File.

type FileInfo

type FileInfo struct {
	IsDirValue   bool
	ModTimeValue time.Time
	ModeValue    fs.FileMode
	NameValue    string
	SizeValue    int64
	SysValue     any
}

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

IsDir implements fs.FileInfo.

func (*FileInfo) ModTime

func (f *FileInfo) ModTime() time.Time

ModTime implements fs.FileInfo.

func (*FileInfo) Mode

func (f *FileInfo) Mode() fs.FileMode

Mode implements fs.FileInfo.

func (*FileInfo) Name

func (f *FileInfo) Name() string

Name implements fs.FileInfo.

func (*FileInfo) Size

func (f *FileInfo) Size() int64

Size implements fs.FileInfo.

func (*FileInfo) Sys

func (f *FileInfo) Sys() any

Sys implements fs.FileInfo.

type Fs

type Fs struct {
	afero.Fs

	ChmodFunc     func(string, fs.FileMode) error
	ChownFunc     func(string, int, int) error
	ChtimesFunc   func(string, time.Time, time.Time) error
	CreateFunc    func(string) (afero.File, error)
	MkdirAllFunc  func(string, fs.FileMode) error
	MkdirFunc     func(string, fs.FileMode) error
	OpenFunc      func(string) (afero.File, error)
	OpenFileFunc  func(string, int, fs.FileMode) (afero.File, error)
	RemoveAllFunc func(string) error
	RemoveFunc    func(string) error
	RenameFunc    func(string, string) error
	StatFunc      func(string) (fs.FileInfo, error)
}

func (*Fs) Chmod

func (f *Fs) Chmod(name string, mode fs.FileMode) error

Chmod implements afero.Fs.

func (*Fs) Chown

func (f *Fs) Chown(name string, uid int, gid int) error

Chown implements afero.Fs.

func (*Fs) Chtimes

func (f *Fs) Chtimes(name string, atime time.Time, mtime time.Time) error

Chtimes implements afero.Fs.

func (*Fs) Create

func (f *Fs) Create(name string) (afero.File, error)

Create implements afero.Fs.

func (*Fs) Mkdir

func (f *Fs) Mkdir(name string, perm fs.FileMode) error

Mkdir implements afero.Fs.

func (*Fs) MkdirAll

func (f *Fs) MkdirAll(path string, perm fs.FileMode) error

MkdirAll implements afero.Fs.

func (*Fs) Name

func (f *Fs) Name() string

Name implements afero.Fs.

func (*Fs) Open

func (f *Fs) Open(name string) (afero.File, error)

Open implements afero.Fs.

func (*Fs) OpenFile

func (f *Fs) OpenFile(name string, flag int, perm fs.FileMode) (afero.File, error)

OpenFile implements afero.Fs.

func (*Fs) Remove

func (f *Fs) Remove(name string) error

Remove implements afero.Fs.

func (*Fs) RemoveAll

func (f *Fs) RemoveAll(path string) error

RemoveAll implements afero.Fs.

func (*Fs) Rename

func (f *Fs) Rename(oldname string, newname string) error

Rename implements afero.Fs.

func (*Fs) Stat

func (f *Fs) Stat(name string) (fs.FileInfo, error)

Stat implements afero.Fs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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