fs

package
v1.5.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disk

type Disk struct {
}

func (*Disk) IsDir

func (d *Disk) IsDir(path string) (bool, error)

func (*Disk) MkdirAll

func (d *Disk) MkdirAll(path string) error

func (*Disk) OpenFile

func (d *Disk) OpenFile(filename string, flag int) (File, error)

func (*Disk) RemoveAll added in v1.2.0

func (d *Disk) RemoveAll(path string) error

func (*Disk) Rename

func (d *Disk) Rename(oldpath, newpath string) error

type DiskFile

type DiskFile struct {
	*os.File
	// contains filtered or unexported fields
}

func (*DiskFile) Close

func (d *DiskFile) Close() error

func (*DiskFile) FileSize

func (d *DiskFile) FileSize() (int64, error)

func (*DiskFile) ReadAll

func (d *DiskFile) ReadAll() ([]byte, error)

func (*DiskFile) ReadAt

func (d *DiskFile) ReadAt(b []byte, off int64) (n int, err error)

func (*DiskFile) Truncate

func (d *DiskFile) Truncate(size int64) error

func (*DiskFile) Write

func (d *DiskFile) Write(b []byte) (n int, err error)

type File

type File interface {
	ReadAt(b []byte, off int64) (n int, err error)
	Write(b []byte) (n int, err error)
	WriteAt(b []byte, off int64) (n int, err error)
	Close() error
	FileSize() (int64, error)
	Truncate(size int64) error
	ReadAll() ([]byte, error)
}

type Fs

type Fs interface {
	OpenFile(filename string, flag int) (File, error)
	MkdirAll(path string) error
	Rename(oldpath, newpath string) error
	// IsDir if not exist, return false whith os.ErrNotExist
	IsDir(path string) (bool, error)
	RemoveAll(path string) error
}

type Memory

type Memory struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Memory) IsDir

func (m *Memory) IsDir(path string) (bool, error)

func (*Memory) MkdirAll

func (m *Memory) MkdirAll(path string) error

func (*Memory) OpenFile

func (m *Memory) OpenFile(filename string, flag int) (File, error)

func (*Memory) RemoveAll added in v1.2.0

func (m *Memory) RemoveAll(path string) error

func (*Memory) Rename

func (m *Memory) Rename(oldpath, newpath string) error

type MemoryFile

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

func (*MemoryFile) Close

func (m *MemoryFile) Close() error

func (*MemoryFile) FileSize

func (m *MemoryFile) FileSize() (int64, error)

func (*MemoryFile) ReadAll

func (m *MemoryFile) ReadAll() ([]byte, error)

func (*MemoryFile) ReadAt

func (m *MemoryFile) ReadAt(b []byte, off int64) (n int, err error)

func (*MemoryFile) Truncate

func (m *MemoryFile) Truncate(size int64) error

func (*MemoryFile) Write

func (m *MemoryFile) Write(b []byte) (n int, err error)

func (*MemoryFile) WriteAt

func (m *MemoryFile) WriteAt(b []byte, off int64) (n int, err error)

Jump to

Keyboard shortcuts

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