fs

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFilePathFromServerPath

func GetFilePathFromServerPath(pathname string) string

func MakeBarePath added in v0.4.2

func MakeBarePath(path string) (string, error)

func ResolveHomeDir

func ResolveHomeDir(path string) string

Types

type FS

type FS interface {
	fs.FS

	OpenFile(path string) (fs.File, error)
	Write(path string, data []byte) error
}

func CreateFileSystem

func CreateFileSystem(root string) FS

func CreateMemoryFileSystem

func CreateMemoryFileSystem() FS

func CreateS3

func CreateS3(bucket string, client *s3.Client) FS

func TryCreateS3

func TryCreateS3(bucket string, region string) (FS, error)

type LocalFS

type LocalFS struct {
	iofs.FS
	// contains filtered or unexported fields
}

func (*LocalFS) OpenFile added in v0.4.2

func (fs *LocalFS) OpenFile(file string) (fs.File, error)

func (*LocalFS) Write

func (fs *LocalFS) Write(path string, data []byte) error

type Lookup

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

func CreateFileSystemLookup

func CreateFileSystemLookup(root string) *Lookup

func CreateLookup

func CreateLookup(root FS) *Lookup

func (*Lookup) Get

func (lookup *Lookup) Get(pathname string) (fs.File, error)

func (*Lookup) Write

func (lookup *Lookup) Write(path string, data []byte) error

type MemFile

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

func (*MemFile) Close

func (f *MemFile) Close() error

func (*MemFile) Read

func (f *MemFile) Read(b []byte) (int, error)

func (*MemFile) Stat

func (f *MemFile) Stat() (iofs.FileInfo, error)

type MemFile2

type MemFile2 interface {
	Stat() (iofs.FileInfo, error)
	Read([]byte) (int, error)
	Close() error
}

type MemFileInfo

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

func (MemFileInfo) IsDir

func (fi MemFileInfo) IsDir() bool

func (MemFileInfo) ModTime

func (fi MemFileInfo) ModTime() time.Time

func (MemFileInfo) Mode

func (fi MemFileInfo) Mode() iofs.FileMode

func (MemFileInfo) Name

func (fi MemFileInfo) Name() string

func (MemFileInfo) Size

func (fi MemFileInfo) Size() int64

func (MemFileInfo) Sys

func (fi MemFileInfo) Sys() any

type MemoryFS

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

func CreateMemoryFS

func CreateMemoryFS() *MemoryFS

func (*MemoryFS) Open

func (mem *MemoryFS) Open(name string) (iofs.File, error)

type MemoryFileSystem

type MemoryFileSystem struct {
	*MemoryFS
}

func (*MemoryFileSystem) OpenFile added in v0.4.2

func (mem *MemoryFileSystem) OpenFile(file string) (fs.File, error)

func (*MemoryFileSystem) Write

func (mem *MemoryFileSystem) Write(path string, data []byte) error

type S3FS

type S3FS struct {
	iofs.FS
	// contains filtered or unexported fields
}

func (*S3FS) OpenFile added in v0.4.2

func (fs *S3FS) OpenFile(file string) (fs.File, error)

func (*S3FS) Write

func (fs *S3FS) Write(key string, data []byte) error

Jump to

Keyboard shortcuts

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