filesystem

package
v0.0.0-...-7570391 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr struct {
	ID   inodedb.ID   `json:"id"`
	Type inodedb.Type `json:"type"`
	Size int64        `json:"size"`

	OrigPath  string    `json:"orig_path"`
	Uid       uint32    `json:"uid"`
	Gid       uint32    `json:"gid"`
	PermMode  uint16    `json:"mode_perm"`
	ModifiedT time.Time `json:"modified_t"`
}

type FileHandle

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

func (*FileHandle) Attr

func (fh *FileHandle) Attr() (Attr, error)

func (*FileHandle) Close

func (fh *FileHandle) Close()

func (*FileHandle) ID

func (fh *FileHandle) ID() inodedb.ID

func (*FileHandle) PWrite

func (fh *FileHandle) PWrite(p []byte, offset int64) error

func (*FileHandle) ReadAt

func (fh *FileHandle) ReadAt(p []byte, offset int64) (int, error)

func (*FileHandle) Size

func (fh *FileHandle) Size() int64

func (*FileHandle) Sync

func (fh *FileHandle) Sync() error

func (*FileHandle) Truncate

func (fh *FileHandle) Truncate(newsize int64) error

type FileSystem

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

func (*FileSystem) Attr

func (fs *FileSystem) Attr(id inodedb.ID) (Attr, error)

func (*FileSystem) CreateDir

func (fs *FileSystem) CreateDir(dirID inodedb.ID, name string, permmode uint16, uid, gid uint32, modifiedT time.Time) (inodedb.ID, error)

func (*FileSystem) CreateDirFullPath

func (fs *FileSystem) CreateDirFullPath(fullpath string, perm uint16, uid, gid uint32, modifiedT time.Time) (inodedb.ID, error)

func (*FileSystem) CreateFile

func (fs *FileSystem) CreateFile(dirID inodedb.ID, name string, permmode uint16, uid, gid uint32, modifiedT time.Time) (inodedb.ID, error)

func (*FileSystem) CreateFileFullPath

func (fs *FileSystem) CreateFileFullPath(fullpath string, perm uint16, uid, gid uint32, modifiedT time.Time) (inodedb.ID, error)

func (*FileSystem) DirEntries

func (fs *FileSystem) DirEntries(id inodedb.ID) (map[string]inodedb.ID, error)

func (*FileSystem) FindNodeFullPath

func (fs *FileSystem) FindNodeFullPath(fullpath string) (inodedb.ID, error)

func (*FileSystem) GetStats

func (fs *FileSystem) GetStats() (ret FileSystemStats)

func (*FileSystem) IsDir

func (fs *FileSystem) IsDir(id inodedb.ID) (bool, error)

func (*FileSystem) OpenFile

func (fs *FileSystem) OpenFile(id inodedb.ID, flags int) (*FileHandle, error)

func (*FileSystem) OpenFileFullPath

func (fs *FileSystem) OpenFileFullPath(fullpath string, flags int, perm uint16) (*FileHandle, error)

func (*FileSystem) ParentID

func (fs *FileSystem) ParentID(id inodedb.ID) (inodedb.ID, error)

func (*FileSystem) Remove

func (fs *FileSystem) Remove(dirID inodedb.ID, name string) error

func (*FileSystem) Rename

func (fs *FileSystem) Rename(srcDirID inodedb.ID, srcName string, dstDirID inodedb.ID, dstName string) error

func (*FileSystem) SetAttr

func (fs *FileSystem) SetAttr(id inodedb.ID, a Attr, valid ValidAttrFields) error

func (*FileSystem) Sync

func (fs *FileSystem) Sync() error

func (*FileSystem) SyncFile

func (fs *FileSystem) SyncFile(id inodedb.ID) error

func (*FileSystem) TotalSize

func (fs *FileSystem) TotalSize() (int64, error)

func (*FileSystem) TruncateFile

func (fs *FileSystem) TruncateFile(id inodedb.ID, newsize int64) error

func (*FileSystem) WriteFile

func (fs *FileSystem) WriteFile(fullpath string, content []byte, perm uint16) error

type FileSystemStats

type FileSystemStats struct {
	NumOpenFiles int `json:"num_open_files"`
	NumOrigPath  int `json:"num_orig_path"`
}

type INodeDBChunksArrayIO

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

func NewINodeDBChunksArrayIO

func NewINodeDBChunksArrayIO(db inodedb.DBHandler, nlock inodedb.NodeLock) *INodeDBChunksArrayIO

func (*INodeDBChunksArrayIO) Read

func (caio *INodeDBChunksArrayIO) Read() ([]inodedb.FileChunk, error)

func (*INodeDBChunksArrayIO) Write

func (caio *INodeDBChunksArrayIO) Write(cs []inodedb.FileChunk) error

type OpenFile

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

func (*OpenFile) Append

func (of *OpenFile) Append(p []byte) error

func (*OpenFile) CloseHandle

func (of *OpenFile) CloseHandle(tgt *FileHandle)

func (*OpenFile) OpenHandleWithoutLock

func (of *OpenFile) OpenHandleWithoutLock(flags int) *FileHandle

func (*OpenFile) PWrite

func (of *OpenFile) PWrite(p []byte, offset int64) error

func (*OpenFile) ReadAt

func (of *OpenFile) ReadAt(p []byte, offset int64) (int, error)

func (*OpenFile) Size

func (of *OpenFile) Size() int64

func (*OpenFile) Sync

func (of *OpenFile) Sync() error

func (*OpenFile) Truncate

func (of *OpenFile) Truncate(newsize int64) error

type ValidAttrFields

type ValidAttrFields uint32
const (
	UidValid ValidAttrFields = 1 << iota
	GidValid
	PermModeValid
	ModifiedTValid
)

func (ValidAttrFields) String

func (valid ValidAttrFields) String() string

Jump to

Keyboard shortcuts

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