fix a code broken when documenting
Showing
1 changed file
with
7 additions
and
6 deletions
| ... | @@ -34,9 +34,9 @@ type FileCacheItem struct { | ... | @@ -34,9 +34,9 @@ type FileCacheItem struct { |
| 34 | 34 | ||
| 35 | var ( | 35 | var ( |
| 36 | FileCachePath string = "cache" // cache directory | 36 | FileCachePath string = "cache" // cache directory |
| 37 | FileCacheFileSuffix string = ".bin" // cache file suffix | 37 | FileCacheFileSuffix string = ".bin" // cache file suffix |
| 38 | FileCacheDirectoryLevel int = 2 // cache file deep level if auto generated cache files. | 38 | FileCacheDirectoryLevel int = 2 // cache file deep level if auto generated cache files. |
| 39 | FileCacheEmbedExpiry int64 = 0 // cache expire time, default is no expire forever. | 39 | FileCacheEmbedExpiry int64 = 0 // cache expire time, default is no expire forever. |
| 40 | ) | 40 | ) |
| 41 | 41 | ||
| 42 | // FileCache is cache adapter for file storage. | 42 | // FileCache is cache adapter for file storage. |
| ... | @@ -47,10 +47,11 @@ type FileCache struct { | ... | @@ -47,10 +47,11 @@ type FileCache struct { |
| 47 | EmbedExpiry int | 47 | EmbedExpiry int |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | // Create new file cache with default directory and suffix. | 50 | // Create new file cache with no config. |
| 51 | // the level and expiry need set in method StartAndGC as config string. | 51 | // the level and expiry need set in method StartAndGC as config string. |
| 52 | func NewFileCache() *FileCache { | 52 | func NewFileCache() *FileCache { |
| 53 | return &FileCache{CachePath:FileCachePath, FileSuffix:FileCacheFileSuffix} | 53 | // return &FileCache{CachePath:FileCachePath, FileSuffix:FileCacheFileSuffix} |
| 54 | return &FileCache{} | ||
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | // Start and begin gc for file cache. | 57 | // Start and begin gc for file cache. |
| ... | @@ -142,7 +143,7 @@ func (this *FileCache) Get(key string) interface{} { | ... | @@ -142,7 +143,7 @@ func (this *FileCache) Get(key string) interface{} { |
| 142 | } | 143 | } |
| 143 | 144 | ||
| 144 | // Put value into file cache. | 145 | // Put value into file cache. |
| 145 | // timeout means how long to keep this file, unit of second. | 146 | // timeout means how long to keep this file, unit of ms. |
| 146 | func (this *FileCache) Put(key string, val interface{}, timeout int64) error { | 147 | func (this *FileCache) Put(key string, val interface{}, timeout int64) error { |
| 147 | filename := this.getCacheFileName(key) | 148 | filename := this.getCacheFileName(key) |
| 148 | var item FileCacheItem | 149 | var item FileCacheItem | ... | ... |
-
Please register or sign in to post a comment