Documentation
¶
Overview ¶
Package db is the persistent cache of Telega lookup results.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache wraps a SQLite connection scoped to antitelega's lookups table.
func Open ¶
Open creates the parent directory if needed, opens the SQLite file, and applies the schema. ttl is how long a result is considered fresh.
func (*Cache) Get ¶
Get returns a cached lookup if it exists and has not expired. Returns (zero, false, nil) if absent or stale.
func (*Cache) GetMany ¶
GetMany returns cached fresh lookups for a slice of user IDs. Missing/stale entries are simply not included in the result.
Click to show internal directories.
Click to hide internal directories.