-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from wolfrace/cache_limits_v2
Cache limits with LRU v2
- Loading branch information
Showing
8 changed files
with
473 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package fscache | ||
|
||
import ( | ||
"os" | ||
"time" | ||
) | ||
|
||
type FileInfo struct { | ||
os.FileInfo | ||
Atime time.Time | ||
} | ||
|
||
type fileInfo struct { | ||
name string | ||
size int64 | ||
fileMode os.FileMode | ||
isDir bool | ||
sys interface{} | ||
wt time.Time | ||
} | ||
|
||
func (f *fileInfo) Name() string { | ||
return f.name | ||
} | ||
|
||
func (f *fileInfo) Size() int64 { | ||
return f.size | ||
} | ||
|
||
func (f *fileInfo) Mode() os.FileMode { | ||
return f.fileMode | ||
} | ||
|
||
func (f *fileInfo) ModTime() time.Time { | ||
return f.wt | ||
} | ||
|
||
func (f *fileInfo) IsDir() bool { | ||
return f.isDir | ||
} | ||
|
||
func (f *fileInfo) Sys() interface{} { | ||
return f.sys | ||
} | ||
|
||
// AccessTime returns the last time the file was read. | ||
// It will be used to check expiry of a file, and must be concurrent safe | ||
// with modifications to the FileSystem (writes, reads etc.) | ||
func (f *FileInfo) AccessTime() time.Time { | ||
return f.Atime | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.