-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbd1f4b
commit 6272cfd
Showing
4 changed files
with
87 additions
and
29 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
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 |
---|---|---|
@@ -1,5 +1,32 @@ | ||
// Polacache is a simple and thread-safe map cache. | ||
|
||
// Polacache is deadly a simple and thread-safe map cache. | ||
// | ||
// In it's constructor, you set a cleanupInterval, which launchs | ||
// a goroutine to perform the cleanup loop. | ||
// | ||
// | ||
// Example: | ||
// | ||
// package main | ||
// | ||
// import ( | ||
// "time" | ||
// | ||
// pc "github.com/nowayhecodes/polacache" | ||
// ) | ||
// | ||
// func main() { | ||
// cache := pc.New(1 * time.Minute) | ||
// | ||
// exampleItem := pc.Item{ | ||
// Key: "example", | ||
// Value: 42, | ||
// } | ||
// | ||
// cache.Set(exampleItem, time.Now().Add(1*time.Hour).Unix()) | ||
// cache.Get(exampleItem.Key) | ||
// cache.Delete(exampleItem.Key) | ||
// | ||
// } | ||
// | ||
// ... | ||
package polacache |
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