Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SpaceLimitCache ¶
type SpaceLimitCache struct {
// contains filtered or unexported fields
}
SpaceLimitCache lru缓存封装, 控制占用空间大小
func NewSpaceLimitCache ¶
func NewSpaceLimitCache(num, maxByteSize int) *SpaceLimitCache
NewSpaceLimitCache new space limit cache
func (*SpaceLimitCache) Add ¶
func (c *SpaceLimitCache) Add(key interface{}, val interface{}, size int) bool
Add add key val
func (*SpaceLimitCache) Contains ¶
func (c *SpaceLimitCache) Contains(key interface{}) bool
Contains check if exist
func (*SpaceLimitCache) Get ¶
func (c *SpaceLimitCache) Get(key interface{}) interface{}
Get get key
func (*SpaceLimitCache) Remove ¶
func (c *SpaceLimitCache) Remove(key interface{}) (interface{}, bool)
Remove remove key
Click to show internal directories.
Click to hide internal directories.