Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
func Initialize()
Initialize initializes the cache database connection.
No parameters. No return values.
Types ¶
type Cache ¶
type Cache[T any] struct { // contains filtered or unexported fields }
Cache struct
func NewCache ¶
NewCache creates a new pointer to Cache struct.
Parameters: - name: a string representing the name of the cache. - ttl: a time.Duration representing the time to live for the cache items. Returns a pointer to Cache[T].
func (*Cache[T]) Del ¶
Del delete data in cachedDB.
ctx: The context for the cache operation. Returns an error.
func (*Cache[T]) Many ¶
Many retrieves multiple items of type T from the cache.
ctx: The context for the cache operation. Returns a slice of retrieved items of type T and an error.
Click to show internal directories.
Click to hide internal directories.