MCPcopy
hub / github.com/jackc/pgx / LRUCache

Struct LRUCache

internal/stmtcache/lru_cache.go:15–26  ·  view source on GitHub ↗

LRUCache implements Cache with a Least Recently Used (LRU) cache.

Source from the content-addressed store, hash-verified

13
14// LRUCache implements Cache with a Least Recently Used (LRU) cache.
15type LRUCache struct {
16 m map[string]*lruNode
17 head *lruNode
18
19 tail *lruNode
20 len int
21 cap int
22 freelist *lruNode
23
24 invalidStmts []*pgconn.StatementDescription
25 invalidSet map[string]struct{}
26}
27
28// NewLRUCache creates a new LRUCache. cap is the maximum size of the cache.
29func NewLRUCache(cap int) *LRUCache {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected