fixed formatting
This commit is contained in:
parent
a6be55d590
commit
3969366c62
20
cache.go
20
cache.go
|
@ -13,13 +13,13 @@ import (
|
||||||
|
|
||||||
|
|
||||||
type Item struct {
|
type Item struct {
|
||||||
Object interface{}
|
Object interface{}
|
||||||
Expiration int64
|
Expiration int64
|
||||||
}
|
}
|
||||||
|
|
||||||
type Node struct {
|
type Node struct {
|
||||||
Expiration int64
|
Expiration int64
|
||||||
Key string
|
Key string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (node Node) Less(than llrb.Item) bool {
|
func (node Node) Less(than llrb.Item) bool {
|
||||||
|
@ -50,12 +50,12 @@ type Cache struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type cache struct {
|
type cache struct {
|
||||||
defaultExpiration time.Duration
|
defaultExpiration time.Duration
|
||||||
items map[string]Item
|
items map[string]Item
|
||||||
mu sync.RWMutex
|
mu sync.RWMutex
|
||||||
onEvicted func(string, interface{})
|
onEvicted func(string, interface{})
|
||||||
janitor *janitor
|
janitor *janitor
|
||||||
sortedItems *llrb.LLRB
|
sortedItems *llrb.LLRB
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add an item to the cache, replacing any existing item. If the duration is 0
|
// Add an item to the cache, replacing any existing item. If the duration is 0
|
||||||
|
|
Loading…
Reference in New Issue