crs

package
v0.16.13 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LFU

type LFU struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(size uint) *LFU

New ...

func (*LFU) Cap

func (list *LFU) Cap() uint

func (*LFU) ClearHard

func (list *LFU) ClearHard()

func (*LFU) ClearSoft

func (list *LFU) ClearSoft()

func (*LFU) ClearTableNils

func (list *LFU) ClearTableNils()

func (*LFU) ClearTables

func (list *LFU) ClearTables()

func (*LFU) CreateCacheableItem

func (list *LFU) CreateCacheableItem(content interface{}) *LFUItem

CreateCacheableItem ...

func (*LFU) Delete

func (list *LFU) Delete(id Snowflake)

Delete ...

func (*LFU) Efficiency

func (list *LFU) Efficiency() float64

Efficiency ...

func (*LFU) Get

func (list *LFU) Get(id Snowflake) (ret *LFUItem, exists bool)

Get get an content from the list.

func (*LFU) RefreshAfterDiscordUpdate

func (list *LFU) RefreshAfterDiscordUpdate(item *LFUItem)

RefreshAfterDiscordUpdate ...

func (*LFU) Set

func (list *LFU) Set(id Snowflake, newItem *LFUItem)

Set set adds a new content to the list or returns false if the content already exists

func (*LFU) Size

func (list *LFU) Size() uint

type LFUItem

type LFUItem struct {
	ID  Snowflake
	Val interface{}
	// contains filtered or unexported fields
}

LFUItem ...

type Snowflake

type Snowflake = util.Snowflake

Jump to

Keyboard shortcuts

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