utils

package
v1.65.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL