gobilly

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbFs

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

func NewDbFs

func NewDbFs(store store.Store) *DbFs

func (*DbFs) Chroot

func (d *DbFs) Chroot(path string) (billy.Filesystem, error)

func (*DbFs) Create

func (d *DbFs) Create(filename string) (billy.File, error)

func (*DbFs) Join

func (d *DbFs) Join(elem ...string) string

func (*DbFs) Lstat

func (d *DbFs) Lstat(filename string) (os.FileInfo, error)

func (*DbFs) MkdirAll

func (d *DbFs) MkdirAll(filename string, perm os.FileMode) error

MkdirAll 传递 ” 和 '/' 都将会创建 root 目录

func (*DbFs) Open

func (d *DbFs) Open(filename string) (billy.File, error)

func (*DbFs) OpenFile

func (d *DbFs) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error)

func (*DbFs) ReadDir

func (d *DbFs) ReadDir(path string) ([]os.FileInfo, error)
func (d *DbFs) Readlink(link string) (string, error)

func (*DbFs) Remove

func (d *DbFs) Remove(filename string) error

Remove 支持删除 文件 和 文件夹 TODO 测试删除文件夹

func (*DbFs) Rename

func (d *DbFs) Rename(oldName, newName string) error

func (*DbFs) Root

func (d *DbFs) Root() string

func (*DbFs) Stat

func (d *DbFs) Stat(filename string) (os.FileInfo, error)

Stat TODO 将 FileInfo 与文件分开存储,避免每次读取信息都读大文件内容

func (d *DbFs) Symlink(target, link string) error

Symlink 暂时不实现

func (*DbFs) TempFile

func (d *DbFs) TempFile(dir, prefix string) (billy.File, error)

type File

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

func NewFile

func NewFile(kvStore store.Store, name string) *File

func (*File) Close

func (f *File) Close() error

func (*File) Info

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

func (*File) IsDir

func (f *File) IsDir() bool

func (*File) Lock

func (f *File) Lock() error

func (*File) ModTime

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

func (*File) Mode

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

func (*File) Name

func (f *File) Name() string

func (*File) Read

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

func (*File) ReadAt

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

func (*File) Seek

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

func (*File) Size

func (f *File) Size() int64

func (*File) Sys

func (f *File) Sys() any

func (*File) Truncate

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

func (*File) Type

func (f *File) Type() fs.FileMode

func (*File) Unlock

func (f *File) Unlock() error

func (*File) Write

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

func (*File) WriteDir

func (f *File) WriteDir() (err error)

type FileAttr

type FileAttr struct {
	MTime uint64
	CTime uint64
	Size  uint64
	Mode  os.FileMode
}

type StdFs

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

StdFs implement io/fs

func NewStdFs

func NewStdFs(under billy.Filesystem) *StdFs

func (*StdFs) Open

func (s *StdFs) Open(name string) (fs.File, error)

Jump to

Keyboard shortcuts

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