interfaces

package
v0.10.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheAlger

type CacheAlger interface {
	Lock()
	Unlock()
	RLock()
	RUnlock()

	Get(id Snowflake) (item CacheableItem, exists bool)
	Set(id Snowflake, new CacheableItem)
	Delete(id Snowflake)
	CreateCacheableItem(content interface{}) CacheableItem
	RefreshAfterDiscordUpdate(item CacheableItem)
	Efficiency() float64

	// Size returns the number of actual elements in the list
	Size() uint

	// Cap returns the capacity of the cache. Note that 0 means there is no limit
	Cap() uint

	// ClearSoft calls ClearTables and creates a new list slice/map.
	ClearSoft()

	// ClearHard forces instant GC on every element in the list + tables
	ClearHard()

	// ClearTableNils removes nil objects from the tracking table
	ClearTableNils()

	// ClearTables clears tracking tables, such that the list can be overwritten with new content. But does not clear the list.
	ClearTables()
}

CacheAlger a cache replacement algorithm interface

type CacheableItem

type CacheableItem interface {
	Object() interface{}
	Set(v interface{})
}

CacheableItem an item that can be cached

type Snowflake

type Snowflake = snowflake.Snowflake

Snowflake ...

Jump to

Keyboard shortcuts

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