fs

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LinkCount = 1
	Delimiter = "/"
)

Variables

This section is empty.

Functions

func FileIDFromString

func FileIDFromString(str string) uint64

Types

type FileCache

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

func NewFileCache

func NewFileCache(dir string) *FileCache

func (*FileCache) Get

func (c *FileCache) Get(key string) (*os.File, error)

func (*FileCache) Set

func (c *FileCache) Set(key string, content io.ReadCloser, expected int64) (*os.File, error)

type FileInfo

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

func ImmutableDir

func ImmutableDir(filename string, mtime time.Time) *FileInfo

func ImmutableInfo

func ImmutableInfo(filename string, mtime time.Time, mode os.FileMode, size int64, opener Opener) *FileInfo

func (*FileInfo) AsPath

func (f *FileInfo) AsPath(filename string) *FileInfo

func (*FileInfo) ContentType

func (f *FileInfo) ContentType(ctx context.Context) (string, error)

ContentType implements webdav.ContentTyper

func (*FileInfo) ETag

func (f *FileInfo) ETag(ctx context.Context) (string, error)

ETag implements webdav.ETager

func (*FileInfo) FileID

func (f *FileInfo) FileID() uint64

func (*FileInfo) FullPath

func (f *FileInfo) FullPath() string

func (*FileInfo) Gid

func (f *FileInfo) Gid() uint32

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

func (*FileInfo) ModTime

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

func (*FileInfo) Mode

func (f *FileInfo) Mode() fs.FileMode
func (f *FileInfo) NLink() uint32

func (*FileInfo) Name

func (f *FileInfo) Name() string

func (*FileInfo) Open

func (f *FileInfo) Open(flag int, perm os.FileMode) (FileLike, error)

func (*FileInfo) Size

func (f *FileInfo) Size() int64

func (*FileInfo) Sys

func (f *FileInfo) Sys() any

func (*FileInfo) Uid

func (f *FileInfo) Uid() uint32

type FileInfoList

type FileInfoList []*FileInfo

func (FileInfoList) Len

func (a FileInfoList) Len() int

func (FileInfoList) Less

func (a FileInfoList) Less(i, j int) bool

func (FileInfoList) Swap

func (a FileInfoList) Swap(i, j int)

func (FileInfoList) ToOSFiles

func (a FileInfoList) ToOSFiles() []os.FileInfo

type FileLike

type FileLike interface {
	io.Reader
	io.ReaderAt
	io.Writer
	io.WriterAt
	io.Seeker
	io.Closer
}

type OpenFn

type OpenFn func(fullPath string, flag int, perm os.FileMode) (FileLike, error)

func (OpenFn) Open

func (o OpenFn) Open(fullPath string, flag int, perm os.FileMode) (FileLike, error)

type Opener

type Opener interface {
	Open(fullPath string, flag int, perm os.FileMode) (FileLike, error)
}

Jump to

Keyboard shortcuts

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