afhack

package
v0.0.0-...-fb842f2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TraceFile

type TraceFile struct {
	FD uint64
	F  afero.File
	// contains filtered or unexported fields
}

func NewTraceFile

func NewTraceFile(fs *TraceFs, fd uint64, f afero.File) *TraceFile

func (*TraceFile) Close

func (f *TraceFile) Close() error

func (*TraceFile) Name

func (f *TraceFile) Name() string

func (*TraceFile) Read

func (f *TraceFile) Read(p []byte) (int, error)

func (*TraceFile) ReadAt

func (f *TraceFile) ReadAt(p []byte, off int64) (int, error)

func (*TraceFile) Readdir

func (f *TraceFile) Readdir(count int) ([]os.FileInfo, error)

func (*TraceFile) Readdirnames

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

func (*TraceFile) Seek

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

func (*TraceFile) Stat

func (f *TraceFile) Stat() (os.FileInfo, error)

func (TraceFile) String

func (f TraceFile) String() string

func (*TraceFile) Sync

func (f *TraceFile) Sync() error

func (*TraceFile) Truncate

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

func (*TraceFile) Write

func (f *TraceFile) Write(p []byte) (int, error)

func (*TraceFile) WriteAt

func (f *TraceFile) WriteAt(p []byte, off int64) (int, error)

func (*TraceFile) WriteString

func (f *TraceFile) WriteString(s string) (int, error)

type TraceFileInfo

type TraceFileInfo struct {
	Name    string
	Size    int64
	Mode    os.FileMode
	ModTime time.Time
	IsDir   bool
	Sys     interface{}
}

type TraceFs

type TraceFs struct {
	L      *zap.Logger
	FS     afero.Fs
	NextFD uint64
}

A TraceFs wraps an afero.Fs filesystem and logs all IO operations. As with all low level tracing, it adds overhead, and the output is quite noisy.

func NewTraceFs

func NewTraceFs(L *zap.Logger, fs afero.Fs) *TraceFs

func (*TraceFs) Chmod

func (fs *TraceFs) Chmod(name string, mode os.FileMode) error

func (*TraceFs) Chtimes

func (fs *TraceFs) Chtimes(name string, atime time.Time, mtime time.Time) error

func (*TraceFs) Create

func (fs *TraceFs) Create(name string) (afero.File, error)

func (*TraceFs) Mkdir

func (fs *TraceFs) Mkdir(name string, perm os.FileMode) error

func (*TraceFs) MkdirAll

func (fs *TraceFs) MkdirAll(path string, perm os.FileMode) error

func (*TraceFs) Name

func (fs *TraceFs) Name() string

func (*TraceFs) Open

func (fs *TraceFs) Open(name string) (afero.File, error)

func (*TraceFs) OpenFile

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

func (*TraceFs) Remove

func (fs *TraceFs) Remove(name string) error

func (*TraceFs) RemoveAll

func (fs *TraceFs) RemoveAll(path string) error

func (*TraceFs) Rename

func (fs *TraceFs) Rename(oldname, newname string) error

func (*TraceFs) Stat

func (fs *TraceFs) Stat(name string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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