package
Version:
v0.12.0
Opens a new window with list of versions in this module.
Published: Jul 5, 2025
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package cache provides a generic cache for ISUCON.
-
func ResetAll()
-
type Cache
-
func (c *Cache[K, V]) Delete(key K)
-
func (c *Cache[K, V]) ForEach(f func(key K, value V) error) (err error)
-
func (c *Cache[K, V]) Get(key K) (value V, ok bool)
-
func (c *Cache[K, V]) GetAndDelete(key K) (value V, ok bool)
-
func (c *Cache[K, V]) Reset()
-
func (c *Cache[K, V]) Set(key K, value V)
ResetAll `NewCache()`で生成した全てのキャッシュをリセット
Cache ジェネリックで、スレッドセーフなマップキャッシュ
sync.Mapのジェネリックなラッパーです
func (c *Cache[K, V]) Delete(key K)
Delete 指定したKeyのキャッシュを削除
ForEach キャッシュの全ての要素に対して処理を行う
func (c *Cache[K, V]) Get(key K) (value V, ok bool)
Get 指定したKeyのキャッシュを取得
func (c *Cache[K, V]) GetAndDelete(key K) (value V, ok bool)
GetAndDelete 指定したKeyのキャッシュを取得して削除
func (c *Cache[K, V]) Reset()
Reset 全てのキャッシュを削除
func (c *Cache[K, V]) Set(key K, value V)
Set 指定したKey-Valueのセットをキャッシュに入れる
Source Files
¶
Click to show internal directories.
Click to hide internal directories.