Documentation ¶
Index ¶
Constants ¶
View Source
const IdentifierPrefix = "gorm-caches::"
Variables ¶
This section is empty.
Functions ¶
func SetPointedValue ¶
func SetPointedValue(dest interface{}, src interface{})
func SetUseCache ¶
SetUseCache enables or disables cache based on the value of `useCache`
Types ¶
type Cacher ¶
type Cacher interface { // Get impl should check if a specific key exists in the cache and return its value // look at Query.Marshal Get(ctx context.Context, key string, q *Query[any]) (*Query[any], error) // Store impl should store a cached representation of the val param // look at Query.Unmarshal Store(ctx context.Context, key string, val *Query[any], ttl time.Duration) error // Invalidate impl should invalidate all cached values // It will be called when INSERT / UPDATE / DELETE queries are sent to the DB Invalidate(ctx context.Context) error }
type RedisCacher ¶
type RedisCacher struct {
// contains filtered or unexported fields
}
func NewRedisCacher ¶
func NewRedisCacher(settings config.RedisSettings) *RedisCacher
func (*RedisCacher) Invalidate ¶
func (c *RedisCacher) Invalidate(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.