Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UseCacheKey struct{} CacheTTLKey struct{} )
Functions ¶
This section is empty.
Types ¶
type BboltClient ¶ added in v0.0.9
type BboltClient struct {
// contains filtered or unexported fields
}
BboltClient is a wrapper for bbolt client
func NewBboltClient ¶ added in v0.0.9
func NewBboltClient(client *bolt.DB) *BboltClient
NewBboltClient returns a new RedisClient instance
type CacheClient ¶
type CacheClient interface { Get(ctx context.Context, key string) (interface{}, error) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error }
CacheClient is an interface for cache operations
type CacheConfig ¶
type CacheConfig struct { TTL time.Duration // cache expiration time Prefix string // cache key prefix }
CacheConfig is a struct for cache options
type GormCache ¶
type GormCache struct {
// contains filtered or unexported fields
}
GormCache is a cache plugin for gorm
func NewGormCache ¶
func NewGormCache(name string, client CacheClient, config CacheConfig) *GormCache
NewGormCache returns a new GormCache instance
func (*GormCache) Initialize ¶
Initialize initializes the plugin
type MemcacheClient ¶
type MemcacheClient struct {
// contains filtered or unexported fields
}
MemcacheClient is a wrapper for gomemcache client
func NewMemcacheClient ¶
func NewMemcacheClient(client *memcache.Client) *MemcacheClient
NewMemcacheClient returns a new RedisClient instance
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
RedisClient is a wrapper for go-redis client
func NewRedisClient ¶
func NewRedisClient(client *redis.Client) *RedisClient
NewRedisClient returns a new RedisClient instance
Source Files ¶
Click to show internal directories.
Click to hide internal directories.