Documentation
¶
Overview ¶
Package cache provides a simple in-file cache implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[T any] struct { // contains filtered or unexported fields }
Cache is a generic cache implementation that stores data in files.
type Conversations ¶
type Conversations struct {
// contains filtered or unexported fields
}
Conversations is the conversation cache.
func NewConversations ¶
func NewConversations(dir string) (*Conversations, error)
NewConversations creates a new conversation cache.
func (*Conversations) Delete ¶
func (c *Conversations) Delete(id string) error
Delete a conversation.
type ExpiringCache ¶
type ExpiringCache[T any] struct { // contains filtered or unexported fields }
ExpiringCache is a cache implementation that supports expiration of cached items.
func NewExpiring ¶
func NewExpiring[T any](path string) (*ExpiringCache[T], error)
NewExpiring creates a new cache instance that supports item expiration.
func (*ExpiringCache[T]) Delete ¶
func (c *ExpiringCache[T]) Delete(id string) error
Delete removes an expired cached item by its ID.
Click to show internal directories.
Click to hide internal directories.