Documentation
¶
Index ¶
- Constants
- func NewLevelScanner(path string, openwait time.Duration) filewalk.LevelScanner
- type LargeFile
- type Option
- type R
- func (f *R) Base(path string) string
- func (f *R) Delete(ctx context.Context, path string) error
- func (f *R) DeleteAll(ctx context.Context, path string) error
- func (f *R) EnsurePrefix(ctx context.Context, path string, perm fs.FileMode) error
- func (f *R) Get(ctx context.Context, path string) ([]byte, error)
- func (f *R) IsNotExist(err error) bool
- func (f *R) IsPermissionError(err error) bool
- func (f *R) Join(components ...string) string
- func (f *R) LevelScanner(prefix string) filewalk.LevelScanner
- func (f *R) Lstat(ctx context.Context, path string) (file.Info, error)
- func (f *R) Open(name string) (fs.File, error)
- func (f *R) OpenCtx(ctx context.Context, name string) (fs.File, error)
- func (f *R) Put(ctx context.Context, path string, perm fs.FileMode, data []byte) error
- func (f *R) ReadFile(name string) ([]byte, error)
- func (f *R) ReadFileCtx(ctx context.Context, name string) ([]byte, error)
- func (f *R) Readlink(ctx context.Context, path string) (string, error)
- func (f *R) Scheme() string
- func (f *R) Stat(ctx context.Context, path string) (file.Info, error)
- func (f *R) SysXAttr(existing any, merge file.XAttr) any
- func (f *R) WriteFile(name string, data []byte, perm fs.FileMode) error
- func (f *R) WriteFileCtx(ctx context.Context, name string, data []byte, perm fs.FileMode) error
- func (f *R) XAttr(ctx context.Context, name string, info file.Info) (file.XAttr, error)
- type T
- func (f *T) Base(path string) string
- func (f *T) Delete(_ context.Context, path string) error
- func (f *T) DeleteAll(_ context.Context, path string) error
- func (f *T) EnsurePrefix(_ context.Context, path string, perm fs.FileMode) error
- func (f *T) Get(_ context.Context, path string) ([]byte, error)
- func (f *T) IsNotExist(err error) bool
- func (f *T) IsPermissionError(err error) bool
- func (f *T) Join(components ...string) string
- func (f *T) LevelScanner(prefix string) filewalk.LevelScanner
- func (f *T) Lstat(_ context.Context, path string) (file.Info, error)
- func (f *T) Open(name string) (fs.File, error)
- func (f *T) OpenCtx(_ context.Context, name string) (fs.File, error)
- func (f *T) Put(_ context.Context, path string, perm fs.FileMode, data []byte) error
- func (f *T) ReadFile(name string) ([]byte, error)
- func (f *T) ReadFileCtx(_ context.Context, name string) ([]byte, error)
- func (f *T) Readlink(_ context.Context, path string) (string, error)
- func (f *T) Scheme() string
- func (f *T) Stat(_ context.Context, path string) (file.Info, error)
- func (f *T) SysXAttr(existing any, merge file.XAttr) any
- func (f *T) WriteFile(name string, data []byte, perm fs.FileMode) error
- func (f *T) WriteFileCtx(_ context.Context, name string, data []byte, perm fs.FileMode) error
- func (f *T) XAttr(_ context.Context, name string, info file.Info) (file.XAttr, error)
Constants ¶
const DefaultLargeFileBlockSize = 1024 * 1024 * 16 // Default block size is 16 MiB.
Variables ¶
This section is empty.
Functions ¶
func NewLevelScanner ¶
func NewLevelScanner(path string, openwait time.Duration) filewalk.LevelScanner
Types ¶
type LargeFile ¶
type LargeFile struct {
// contains filtered or unexported fields
}
LargeFile is a wrapper around a file that supports reading large files in blocks. It implements the largefile.Reader interface.
func NewLargeFile ¶
NewLargeFile creates a new LargeFile instance that wraps the provided file and uses the specified block size for reading. The supplied digest is simply returned by the Digest() method and is not used to validate the file's contents directly.
func (*LargeFile) ContentLengthAndBlockSize ¶
ContentLengthAndBlockSize implements largefile.Reader.
type Option ¶
type Option func(o *options)
func WithScannerOpenWait ¶
WithScannerOpenWait configures the amount of time to wait for the scanner to open a file before timing out. If zero then no timeout is applied and open is called directly.
type R ¶
type R struct {
*T
// contains filtered or unexported fields
}
R represents a local filesystem tree that is rooted at a specified directory.
func NewRoot ¶
NewRoot returns an instance of file.FS that provides access to the local filesystem tree rooted at the specified directory.
func (*R) EnsurePrefix ¶
func (*R) IsNotExist ¶
func (*R) IsPermissionError ¶
func (*R) LevelScanner ¶
func (f *R) LevelScanner(prefix string) filewalk.LevelScanner
func (*R) WriteFileCtx ¶
type T ¶
type T struct {
// contains filtered or unexported fields
}
T represents the local filesystem. It implements FS, ObjectFS and filewalk.FS
func (*T) EnsurePrefix ¶
func (*T) IsNotExist ¶
func (*T) IsPermissionError ¶
func (*T) LevelScanner ¶
func (f *T) LevelScanner(prefix string) filewalk.LevelScanner