25 lines
319 B
Go
25 lines
319 B
Go
package db
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
"time"
|
|
)
|
|
|
|
type (
|
|
CachingFunc func(tx *gorm.DB) (any, error)
|
|
|
|
CacheOptions struct {
|
|
dependSQL string
|
|
dependArgs []any
|
|
}
|
|
|
|
CacheOption func(o *CacheOptions)
|
|
|
|
cacheEntry struct {
|
|
storeValue any
|
|
compareValue string
|
|
createdAt time.Time
|
|
lastChecked time.Time
|
|
}
|
|
)
|