{"modulePath":"github.com/diffsec/agentmon","version":"v0.0.0-20261111001054-230ac962f687","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package preparedcache\n\nPackage preparedcache is a per-connection LRU prepared-statement cache used by the PostgreSQL proxy. Plan 05a uses it for the wire-protocol Extended Query cache; Plan 05b adds a second instance per connection for SQL-level PREPARE/EXECUTE.\n\nThe default capacity is 4096 entries per spec §7.4.\n\n## Constants\n\n```go\nconst DefaultCapacity = 4096\n```\n\n## Types\n\n```go\ntype Cache struct {\n\t// contains filtered or unexported fields\n}\n```\nCache is a fixed-capacity LRU keyed by prepared-statement name. Empty name is a legal key per §7.4 (unnamed prepared statement).\n\n```go\nfunc New(capacity int) *Cache\n```\nNew returns a Cache with the given capacity. capacity \\\u003c= 0 falls back to DefaultCapacity.\n\n```go\nfunc (c *Cache) Clear()\n```\nClear empties the cache.\n\n```go\nfunc (c *Cache) Delete(name string)\n```\nDelete removes name if present. No-op on miss.\n\n```go\nfunc (c *Cache) Get(name string) (Entry, bool)\n```\nGet returns the cached entry and promotes it to MRU. Second return is false on miss.\n\n```go\nfunc (c *Cache) Len() int\n```\nLen returns the current entry count.\n\n```go\nfunc (c *Cache) Put(name string, e Entry)\n```\nPut inserts or updates name -\u003e e. Existing entries are promoted to MRU. At capacity, the LRU entry is evicted.\n\n```go\ntype Entry struct {\n\tClassification           effects.ClassifiedStatement\n\tRedactionTier            policy.RedactionTier\n\tCatalogRefreshSearchPath bool\n\tCatalogRefreshSnapshot   bool\n\tRedirect                 *RedirectMetadata\n}\n```\nEntry is the cached value: the classified statement plus the redaction tier captured at Parse time so a later Execute renders consistently even if policy is hot-swapped between Parse and Execute.\n\n```go\ntype RedirectMetadata struct {\n\tOriginalClassification   effects.ClassifiedStatement\n\tOriginalSQL              string\n\tOriginalStatementDigest  string\n\tRewrittenStatementDigest string\n\tRule                     string\n\tSourceRelation           string\n\tTargetRelation           string\n\tPolicyIdentity           string\n}\n```\nRedirectMetadata captures parse-time redirect state for wire-protocol prepared statements. Classification on Entry is the rewritten statement; OriginalClassification keeps the client statement for audit.\n\n","path":"github.com/diffsec/agentmon/internal/db/proxy/postgres/preparedcache","name":"preparedcache","synopsis":"Package preparedcache is a per-connection LRU prepared-statement cache used by the PostgreSQL proxy.","isRedistributable":true}
