fs

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExist

func IsExist(err error) bool

func IsNotEmpty

func IsNotEmpty(err error) bool

func IsNotExist

func IsNotExist(err error) bool

func StartHTTPServer added in v1.0.0

func StartHTTPServer(fs *FileSystem, config WebdavConfig)

Types

type Attr

type Attr = meta.Attr

type File

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

func (*File) Chmod

func (f *File) Chmod(ctx meta.Context, mode uint16) (err syscall.Errno)

func (*File) Chown

func (f *File) Chown(ctx meta.Context, uid uint32, gid uint32) (err syscall.Errno)

func (*File) Close

func (f *File) Close(ctx meta.Context) (err syscall.Errno)

func (*File) FS

func (f *File) FS() *FileSystem

func (*File) Flush

func (f *File) Flush(ctx meta.Context) (err syscall.Errno)

func (*File) Fsync

func (f *File) Fsync(ctx meta.Context) (err syscall.Errno)

func (*File) Inode

func (f *File) Inode() Ino

func (*File) Name

func (f *File) Name() string

func (*File) Pread

func (f *File) Pread(ctx meta.Context, b []byte, offset int64) (n int, err error)

func (*File) Pwrite

func (f *File) Pwrite(ctx meta.Context, b []byte, offset int64) (n int, err syscall.Errno)

func (*File) Read

func (f *File) Read(ctx meta.Context, b []byte) (n int, err error)

func (*File) Readdir

func (f *File) Readdir(ctx meta.Context, count int) (fi []os.FileInfo, err syscall.Errno)

func (*File) ReaddirPlus

func (f *File) ReaddirPlus(ctx meta.Context, offset int) (entries []*meta.Entry, err syscall.Errno)

func (*File) Seek

func (f *File) Seek(ctx meta.Context, offset int64, whence int) (int64, error)

func (*File) Stat

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

func (*File) Summary

func (f *File) Summary(ctx meta.Context) (s *meta.Summary, err syscall.Errno)

func (*File) Utime

func (f *File) Utime(ctx meta.Context, atime, mtime int64) (err syscall.Errno)

func (*File) Write

func (f *File) Write(ctx meta.Context, b []byte) (n int, err syscall.Errno)

type FileStat

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

func AttrToFileInfo

func AttrToFileInfo(inode Ino, attr *Attr) *FileStat

func (*FileStat) Atime

func (fs *FileStat) Atime() int64

func (*FileStat) Gid

func (fs *FileStat) Gid() int

func (*FileStat) Inode

func (fs *FileStat) Inode() Ino

func (*FileStat) IsDir

func (fs *FileStat) IsDir() bool
func (fs *FileStat) IsSymlink() bool

func (*FileStat) ModTime

func (fs *FileStat) ModTime() time.Time

func (*FileStat) Mode

func (fs *FileStat) Mode() os.FileMode

func (*FileStat) Mtime

func (fs *FileStat) Mtime() int64

func (*FileStat) Name

func (fs *FileStat) Name() string

func (*FileStat) Size

func (fs *FileStat) Size() int64

func (*FileStat) Sys

func (fs *FileStat) Sys() interface{}

func (*FileStat) Uid

func (fs *FileStat) Uid() int

type FileSystem

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

func NewFileSystem

func NewFileSystem(conf *vfs.Config, m meta.Meta, d chunk.ChunkStore) (*FileSystem, error)

func (*FileSystem) Access

func (fs *FileSystem) Access(ctx meta.Context, path string, flags int) (err syscall.Errno)

func (*FileSystem) Close

func (fs *FileSystem) Close() error

func (*FileSystem) CopyFileRange added in v0.11.0

func (fs *FileSystem) CopyFileRange(ctx meta.Context, src string, soff uint64, dst string, doff uint64, size uint64) (written uint64, err syscall.Errno)

func (*FileSystem) Create

func (fs *FileSystem) Create(ctx meta.Context, p string, mode uint16, umask uint16) (f *File, err syscall.Errno)

func (*FileSystem) Delete

func (fs *FileSystem) Delete(ctx meta.Context, p string) (err syscall.Errno)

func (*FileSystem) Flush

func (fs *FileSystem) Flush() error

func (*FileSystem) GetXattr

func (fs *FileSystem) GetXattr(ctx meta.Context, p string, name string) (result []byte, err syscall.Errno)

func (*FileSystem) InitMetrics added in v1.0.0

func (fs *FileSystem) InitMetrics(reg prometheus.Registerer)

func (*FileSystem) ListXattr

func (fs *FileSystem) ListXattr(ctx meta.Context, p string) (names []byte, err syscall.Errno)

func (*FileSystem) Lopen added in v1.1.1

func (fs *FileSystem) Lopen(ctx meta.Context, path string, flags uint32) (f *File, err syscall.Errno)

open file without following symlink

func (*FileSystem) Lstat added in v1.0.4

func (fs *FileSystem) Lstat(ctx meta.Context, path string) (fi *FileStat, err syscall.Errno)

func (*FileSystem) Meta added in v0.12.0

func (fs *FileSystem) Meta() meta.Meta

func (*FileSystem) Mkdir

func (fs *FileSystem) Mkdir(ctx meta.Context, p string, mode uint16, umask uint16) (err syscall.Errno)

func (*FileSystem) MkdirAll added in v1.1.0

func (fs *FileSystem) MkdirAll(ctx meta.Context, p string, mode uint16, umask uint16) (err syscall.Errno)

func (*FileSystem) Open

func (fs *FileSystem) Open(ctx meta.Context, path string, flags uint32) (*File, syscall.Errno)
func (fs *FileSystem) Readlink(ctx meta.Context, link string) (path []byte, err syscall.Errno)

func (*FileSystem) RemoveXattr

func (fs *FileSystem) RemoveXattr(ctx meta.Context, p string, name string) (err syscall.Errno)

func (*FileSystem) Rename

func (fs *FileSystem) Rename(ctx meta.Context, oldpath string, newpath string, flags uint32) (err syscall.Errno)

func (*FileSystem) Rmr

func (fs *FileSystem) Rmr(ctx meta.Context, p string) (err syscall.Errno)

func (*FileSystem) SetXattr

func (fs *FileSystem) SetXattr(ctx meta.Context, p string, name string, value []byte, flags uint32) (err syscall.Errno)

func (*FileSystem) Stat

func (fs *FileSystem) Stat(ctx meta.Context, path string) (fi *FileStat, err syscall.Errno)

func (*FileSystem) StatFS

func (fs *FileSystem) StatFS(ctx meta.Context) (totalspace uint64, availspace uint64)
func (fs *FileSystem) Symlink(ctx meta.Context, target string, link string) (err syscall.Errno)

func (*FileSystem) Truncate

func (fs *FileSystem) Truncate(ctx meta.Context, path string, length uint64) (err syscall.Errno)

type Ino

type Ino = meta.Ino

type LogContext

type LogContext = vfs.LogContext

type WebdavConfig added in v1.1.0

type WebdavConfig struct {
	Addr         string
	DisallowList bool
	EnableGzip   bool
	Username     string
	Password     string
	CertFile     string
	KeyFile      string
}

Jump to

Keyboard shortcuts

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