Documentation ¶
Index ¶
- type LocalCacheImpl
- func (lc *LocalCacheImpl) Del(ctx context.Context, key string) error
- func (lc *LocalCacheImpl) Get(key string) ([]byte, error)
- func (lc *LocalCacheImpl) Set(key string, value []byte, expiration time.Duration) error
- func (lc *LocalCacheImpl) SetExpiration(key string, expiration time.Duration) error
- func (lc *LocalCacheImpl) TTL(key string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalCacheImpl ¶
type LocalCacheImpl struct {
// contains filtered or unexported fields
}
func NewLocalCacheImpl ¶
func NewLocalCacheImpl(ctx context.Context, maxEntries int) (*LocalCacheImpl, error)
func (*LocalCacheImpl) Get ¶
func (lc *LocalCacheImpl) Get(key string) ([]byte, error)
Get key value. For keys with an expiration setting, a lazy deletion strategy is employed. Before retrieving the value, it first checks if the key has expired. If it has expired, the key is deleted and a null value is returned
func (*LocalCacheImpl) SetExpiration ¶
func (lc *LocalCacheImpl) SetExpiration(key string, expiration time.Duration) error
Click to show internal directories.
Click to hide internal directories.