Documentation
¶
Index ¶
- type Cache
- func (c Cache) Get(ctx context.Context, key []byte) []byte
- func (c Cache) GetFunc(ctx context.Context, key []byte, ttl time.Duration, f func(key []byte) []byte) []byte
- func (c Cache) GetFuncErr(ctx context.Context, key []byte, ttl time.Duration, ...) ([]byte, error)
- func (c Cache) GetGobFuncErr(ctx context.Context, key []byte, ttl time.Duration, output interface{}, ...) error
- func (c Cache) Remove(ctx context.Context, key []byte)
- func (c Cache) Set(ctx context.Context, key, value []byte, ttl time.Duration)
- type DiskCache
- type DiskCache2
- func (cache *DiskCache2) Close()
- func (cache *DiskCache2) Get(ctx context.Context, keyHash dc2Hash) []byte
- func (cache *DiskCache2) GetCache(_ context.Context, prefix string) *Cache
- func (cache *DiskCache2) Remove(ctx context.Context, keyHash dc2Hash) bool
- func (cache *DiskCache2) Set(ctx context.Context, keyHash dc2Hash, value []byte, ttl time.Duration)
- func (cache *DiskCache2) Stats() DiskCache2Stats
- type DiskCache2Stats
- type MemoryCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func NewNoOpCache ¶
func NewNoOpCache() *Cache
func (Cache) GetFuncErr ¶
func (Cache) GetGobFuncErr ¶
type DiskCache ¶
type DiskCache struct {
// contains filtered or unexported fields
}
func NewDiskCache ¶
type DiskCache2 ¶
type DiskCache2 struct {
// contains filtered or unexported fields
}
func NewDiskCache2 ¶
func (*DiskCache2) Close ¶
func (cache *DiskCache2) Close()
func (*DiskCache2) GetCache ¶
func (cache *DiskCache2) GetCache(_ context.Context, prefix string) *Cache
func (*DiskCache2) Remove ¶
func (cache *DiskCache2) Remove(ctx context.Context, keyHash dc2Hash) bool
func (*DiskCache2) Stats ¶
func (cache *DiskCache2) Stats() DiskCache2Stats
type DiskCache2Stats ¶
type MemoryCache ¶
func NewMemoryCache ¶
func NewMemoryCache(byteSize int) *MemoryCache
func (*MemoryCache) GetCache ¶
func (d *MemoryCache) GetCache(prefix string) *Cache
Click to show internal directories.
Click to hide internal directories.