mstorage

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenFile

func OpenFile(path string, readOnly bool, dataPaths []string) (storage.Storage, error)

OpenFile returns instance of MultiDiskStorage supporting multi disks

Types

type MultiDiskStorage

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

MultiDiskStorage is a file-system backed storage.

func (*MultiDiskStorage) Close

func (fs *MultiDiskStorage) Close() error

Close close the instance of MultiDiskStorage

func (*MultiDiskStorage) Create

Create create an instance of Writer with fd

func (*MultiDiskStorage) GetMeta

func (fs *MultiDiskStorage) GetMeta() (storage.FileDesc, error)

GetMeta get meta of instance of MultiDiskStorage

func (*MultiDiskStorage) List

func (fs *MultiDiskStorage) List(ft storage.FileType) (fds []storage.FileDesc, err error)

List list all ft type files info

func (*MultiDiskStorage) Lock

func (fs *MultiDiskStorage) Lock() (storage.Locker, error)

Lock keep instance of MultiDiskStorage unavailable

func (*MultiDiskStorage) Log

func (fs *MultiDiskStorage) Log(str string)

Log emits a string log

func (*MultiDiskStorage) MultiGuessOpenFile

func (fs *MultiDiskStorage) MultiGuessOpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

MultiGuessOpenFile guess which disk the file located in and open

func (*MultiDiskStorage) MultiGuessRemove

func (fs *MultiDiskStorage) MultiGuessRemove(name string) error

MultiGuessRemove guess which disk the file located in and remove

func (*MultiDiskStorage) MultiGuessStat

func (fs *MultiDiskStorage) MultiGuessStat(name string) (os.FileInfo, error)

MultiGuessStat guess which disk the file located in and stat

func (*MultiDiskStorage) MultiList

func (fs *MultiDiskStorage) MultiList(ft storage.FileType) (fds []storage.FileDesc, err error)

MultiList list file in multi disks storage

func (*MultiDiskStorage) MultiOpenFile

func (fs *MultiDiskStorage) MultiOpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

MultiOpenFile open file in multi disks storage

func (*MultiDiskStorage) MultiRemove

func (fs *MultiDiskStorage) MultiRemove(name string) error

MultiRemove remove file in multi disks storage

func (*MultiDiskStorage) MultiStat

func (fs *MultiDiskStorage) MultiStat(name string) (os.FileInfo, error)

MultiStat stat file in multi disks storage

func (*MultiDiskStorage) Open

Open open file with fd file description

func (*MultiDiskStorage) Remove

func (fs *MultiDiskStorage) Remove(fd storage.FileDesc) error

Remove remove file with file description of fd

func (*MultiDiskStorage) Rename

func (fs *MultiDiskStorage) Rename(oldfd, newfd storage.FileDesc) error

Rename rename the file description

func (*MultiDiskStorage) SetMeta

func (fs *MultiDiskStorage) SetMeta(fd storage.FileDesc) error

SetMeta reset meta info for instance of MultiDiskStorage

type MultiDiskStorageLock

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

MultiDiskStorageLock data structure consists of pointer to MultiDiskStorage

func (*MultiDiskStorageLock) Unlock

func (lock *MultiDiskStorageLock) Unlock()

Unlock keep instance of MultiDiskStorageLock available

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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