Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f96eec6d
authored
2013-12-22 15:31:49 +0800
by
傅小黑
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix a code broken when documenting
1 parent
4037f952
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
cache/file.go
cache/file.go
View file @
f96eec6
...
...
@@ -34,9 +34,9 @@ type FileCacheItem struct {
var
(
FileCachePath
string
=
"cache"
// cache directory
FileCacheFileSuffix
string
=
".bin"
// cache file suffix
FileCacheDirectoryLevel
int
=
2
// cache file deep level if auto generated cache files.
FileCacheEmbedExpiry
int64
=
0
// cache expire time, default is no expire forever.
FileCacheFileSuffix
string
=
".bin"
// cache file suffix
FileCacheDirectoryLevel
int
=
2
// cache file deep level if auto generated cache files.
FileCacheEmbedExpiry
int64
=
0
// cache expire time, default is no expire forever.
)
// FileCache is cache adapter for file storage.
...
...
@@ -47,10 +47,11 @@ type FileCache struct {
EmbedExpiry
int
}
// Create new file cache with
default directory and suffix
.
// Create new file cache with
no config
.
// the level and expiry need set in method StartAndGC as config string.
func
NewFileCache
()
*
FileCache
{
return
&
FileCache
{
CachePath
:
FileCachePath
,
FileSuffix
:
FileCacheFileSuffix
}
// return &FileCache{CachePath:FileCachePath, FileSuffix:FileCacheFileSuffix}
return
&
FileCache
{}
}
// Start and begin gc for file cache.
...
...
@@ -142,7 +143,7 @@ func (this *FileCache) Get(key string) interface{} {
}
// Put value into file cache.
// timeout means how long to keep this file, unit of
second
.
// timeout means how long to keep this file, unit of
ms
.
func
(
this
*
FileCache
)
Put
(
key
string
,
val
interface
{},
timeout
int64
)
error
{
filename
:=
this
.
getCacheFileName
(
key
)
var
item
FileCacheItem
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment