25 lines
316 B
Go
25 lines
316 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 any
|
||
|
createdAt time.Time
|
||
|
lastChecked time.Time
|
||
|
}
|
||
|
)
|