fs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: AGPL-3.0 Imports: 26 Imported by: 3

Documentation

Index

Constants

View Source
const (
	O_ACCMODE = syscall.O_ACCMODE
)

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	afero.File
	// contains filtered or unexported fields
}

func NewFile

func NewFile(
	readOps *operations.Operations,
	writeOps *operations.Operations,

	metadata config.MetadataConfig,

	path string,
	link string,
	flags *FileFlags,

	compressionLevel string,
	getFileBuffer func() (cache.WriteCache, func() error, error),
	ioLock *sync.Mutex,

	name string,
	info *FileInfo,

	onHeader func(hdr *config.Header),
	log logging.StructuredLogger,
) *File

func (*File) Close

func (f *File) Close() error

func (*File) Name

func (f *File) Name() string

Inventory

func (*File) Read

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

Read operations

func (*File) ReadAt

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

func (*File) Readdir

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

func (*File) Readdirnames

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

func (*File) Seek

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

Read/write operations

func (*File) Stat

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

func (*File) Sync

func (f *File) Sync() error

Cleanup operations

func (*File) Truncate

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

func (*File) Write

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

Write operations

func (*File) WriteAt

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

func (*File) WriteString

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

type FileFlags

type FileFlags struct {
	Read  bool
	Write bool

	Append   bool
	Truncate bool
}

type FileInfo

type FileInfo struct {
	os.FileInfo
	// contains filtered or unexported fields
}

func NewFileInfo

func NewFileInfo(
	name string,
	size int64,
	mode fs.FileMode,
	modTime time.Time,
	accessTime time.Time,
	changeTime time.Time,
	gid int,
	uid int,
	isDir bool,

	log logging.StructuredLogger,
) *FileInfo

func NewFileInfoFromTarHeader

func NewFileInfoFromTarHeader(
	hdr *tar.Header,

	log logging.StructuredLogger,
) *FileInfo

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

func (*FileInfo) ModTime

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

func (*FileInfo) Mode

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

func (*FileInfo) Name

func (f *FileInfo) Name() string

func (*FileInfo) Size

func (f *FileInfo) Size() int64

func (*FileInfo) Sys

func (f *FileInfo) Sys() interface{}

type STFS

type STFS struct {
	// contains filtered or unexported fields
}

func NewSTFS

func NewSTFS(
	readOps *operations.Operations,
	writeOps *operations.Operations,

	metadata config.MetadataConfig,

	compressionLevel string,
	getFileBuffer func() (cache.WriteCache, func() error, error),
	readOnly bool,
	writePermImpliesReadPerm bool,

	onHeader func(hdr *config.Header),
	log logging.StructuredLogger,
) *STFS

func (*STFS) Chmod

func (f *STFS) Chmod(name string, mode os.FileMode) error

func (*STFS) Chown

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

func (*STFS) Chtimes

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

func (*STFS) Create

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

func (*STFS) Initialize

func (f *STFS) Initialize(rootProposal string, rootPerm os.FileMode) (root string, err error)

func (*STFS) LstatIfPossible

func (f *STFS) LstatIfPossible(name string) (os.FileInfo, bool, error)

func (*STFS) Mkdir

func (f *STFS) Mkdir(name string, perm os.FileMode) error

func (*STFS) MkdirAll

func (f *STFS) MkdirAll(path string, perm os.FileMode) error

func (*STFS) Name

func (f *STFS) Name() string

func (*STFS) Open

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

func (*STFS) OpenFile

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

func (*STFS) ReadlinkIfPossible

func (f *STFS) ReadlinkIfPossible(name string) (string, error)

func (*STFS) Remove

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

func (*STFS) RemoveAll

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

func (*STFS) Rename

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

func (*STFS) Stat

func (f *STFS) Stat(name string) (os.FileInfo, error)

func (*STFS) SymlinkIfPossible

func (f *STFS) SymlinkIfPossible(oldname, newname string) error

type Stat

type Stat syscall.Stat_t

func NewStat

func NewStat(
	uid uint32,
	gid uint32,
	mtim int64,
	atim int64,
	ctim int64,
) *Stat

Jump to

Keyboard shortcuts

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