refactoring

This commit is contained in:
Chris Lu
2019-12-08 19:44:16 -08:00
parent 2b8e20f122
commit 10bd3c6b4b
10 changed files with 15 additions and 24 deletions

View File

@@ -18,7 +18,7 @@ type BackendStorageFile interface {
Truncate(off int64) error
io.Closer
GetStat() (datSize int64, modTime time.Time, err error)
String() string
Name() string
}
type BackendStorage interface {

View File

@@ -45,10 +45,6 @@ func (df *DiskFile) GetStat() (datSize int64, modTime time.Time, err error) {
return 0, time.Time{}, err
}
func (df *DiskFile) String() string {
func (df *DiskFile) Name() string {
return df.fullFilePath
}
func (df *DiskFile) Instantiate(src *os.File) error {
panic("should not implement Instantiate for DiskFile")
}

View File

@@ -55,10 +55,6 @@ func (mmf *MemoryMappedFile) GetStat() (datSize int64, modTime time.Time, err er
return 0, time.Time{}, err
}
func (mmf *MemoryMappedFile) String() string {
func (mmf *MemoryMappedFile) Name() string {
return mmf.mm.File.Name()
}
func (mmf *MemoryMappedFile) Instantiate(src *os.File) error {
panic("should not implement Instantiate for MemoryMappedFile")
}

View File

@@ -153,7 +153,6 @@ func (s3backendStorageFile S3BackendStorageFile) GetStat() (datSize int64, modTi
return
}
func (s3backendStorageFile S3BackendStorageFile) String() string {
func (s3backendStorageFile S3BackendStorageFile) Name() string {
return s3backendStorageFile.key
}