Documentation
¶
Index ¶
- func NewGoCache() cache.ICache
- func NewMemoryCache() cache.ICache
- func NewRedisCache(ds datasource.RedisDataSource) cache.ICache
- type GoCache
- func (g *GoCache) Delete(_ context.Context, keys ...string) error
- func (g *GoCache) Get(_ context.Context, key string) ([]byte, bool, error)
- func (g *GoCache) ImplName() scene.ImplName
- func (g *GoCache) InvalidateTags(_ context.Context, _ ...string) error
- func (g *GoCache) Set(_ context.Context, key string, value []byte, expiration time.Duration, ...) error
- type MemoryCache
- func (m *MemoryCache) Delete(_ context.Context, keys ...string) error
- func (m *MemoryCache) Get(_ context.Context, key string) ([]byte, bool, error)
- func (m *MemoryCache) ImplName() scene.ImplName
- func (m *MemoryCache) InvalidateTags(_ context.Context, tags ...string) error
- func (m *MemoryCache) Set(_ context.Context, key string, value []byte, expiration time.Duration, ...) error
- type MemoryCacheOptions
- type RedisCache
- func (r *RedisCache) Delete(ctx context.Context, keys ...string) error
- func (r *RedisCache) Get(ctx context.Context, key string) ([]byte, bool, error)
- func (r *RedisCache) ImplName() scene.ImplName
- func (r *RedisCache) InvalidateTags(_ context.Context, _ ...string) error
- func (r *RedisCache) Set(ctx context.Context, key string, value []byte, expiration time.Duration, ...) error
- func (r *RedisCache) Setup() error
- func (r *RedisCache) Status() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGoCache ¶ added in v0.2.8
func NewMemoryCache ¶ added in v0.3.6
func NewRedisCache ¶
func NewRedisCache(ds datasource.RedisDataSource) cache.ICache
Types ¶
type GoCache ¶ added in v0.2.8
type GoCache struct {
// contains filtered or unexported fields
}
func (*GoCache) InvalidateTags ¶ added in v0.3.6
type MemoryCache ¶ added in v0.3.6
type MemoryCache struct {
// contains filtered or unexported fields
}
func NewMemoryCacheWithOptions ¶ added in v0.3.6
func NewMemoryCacheWithOptions(opts MemoryCacheOptions) *MemoryCache
func (*MemoryCache) Delete ¶ added in v0.3.6
func (m *MemoryCache) Delete(_ context.Context, keys ...string) error
func (*MemoryCache) ImplName ¶ added in v0.3.6
func (m *MemoryCache) ImplName() scene.ImplName
func (*MemoryCache) InvalidateTags ¶ added in v0.3.6
func (m *MemoryCache) InvalidateTags(_ context.Context, tags ...string) error
type MemoryCacheOptions ¶ added in v0.3.6
type MemoryCacheOptions struct {
// CopyOnRead returns a cloned value on Get when enabled.
// Disable it for better read throughput (returned bytes must be treated as read-only).
CopyOnRead bool
}
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func (*RedisCache) ImplName ¶ added in v0.2.8
func (r *RedisCache) ImplName() scene.ImplName
func (*RedisCache) InvalidateTags ¶ added in v0.3.6
func (r *RedisCache) InvalidateTags(_ context.Context, _ ...string) error
func (*RedisCache) Setup ¶
func (r *RedisCache) Setup() error
func (*RedisCache) Status ¶
func (r *RedisCache) Status() error
Click to show internal directories.
Click to hide internal directories.