mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-07-05 16:38:17 -04:00
34 lines
822 B
Go
34 lines
822 B
Go
|
package filesystemimpl
|
||
|
|
||
|
import (
|
||
|
"github.com/v2fly/v2ray-core/v5/common/environment"
|
||
|
"github.com/v2fly/v2ray-core/v5/common/platform/filesystem"
|
||
|
"github.com/v2fly/v2ray-core/v5/common/platform/filesystem/fsifce"
|
||
|
)
|
||
|
|
||
|
func NewDefaultFileSystemDefaultImpl() environment.FileSystemCapabilitySet {
|
||
|
return fsCapImpl{}
|
||
|
}
|
||
|
|
||
|
type fsCapImpl struct{}
|
||
|
|
||
|
func (f fsCapImpl) OpenFileForReadSeek() fsifce.FileSeekerFunc {
|
||
|
return filesystem.NewFileSeeker
|
||
|
}
|
||
|
|
||
|
func (f fsCapImpl) OpenFileForRead() fsifce.FileReaderFunc {
|
||
|
return filesystem.NewFileReader
|
||
|
}
|
||
|
|
||
|
func (f fsCapImpl) OpenFileForWrite() fsifce.FileWriterFunc {
|
||
|
return filesystem.NewFileWriter
|
||
|
}
|
||
|
|
||
|
func (f fsCapImpl) ReadDir() fsifce.FileReadDirFunc {
|
||
|
return filesystem.NewFileReadDir
|
||
|
}
|
||
|
|
||
|
func (f fsCapImpl) RemoveFile() fsifce.FileRemoveFunc {
|
||
|
return filesystem.NewFileRemover
|
||
|
}
|