Documentation
¶
Index ¶
- Constants
- type BatchItem
- type BatchResult
- type CacheStore
- func (s *CacheStore) Close() error
- func (s *CacheStore) DecrUInt16(key string, delta uint16, exp time.Duration) error
- func (s *CacheStore) DecrUInt32(key string, delta uint32, exp time.Duration) error
- func (s *CacheStore) DecrUInt64(key string, delta uint64, exp time.Duration) error
- func (s *CacheStore) Delete(key string) error
- func (s *CacheStore) Exists(keys ...string) int
- func (s *CacheStore) Flush()
- func (s *CacheStore) FullSync()
- func (s *CacheStore) Get(key string) (types.DataType, []byte, error)
- func (s *CacheStore) GetBool(key string) (bool, error)
- func (s *CacheStore) GetFloat32(key string) (float32, error)
- func (s *CacheStore) GetFloat64(key string) (float64, error)
- func (s *CacheStore) GetInt16(key string) (int16, error)
- func (s *CacheStore) GetInt32(key string) (int32, error)
- func (s *CacheStore) GetInt64(key string) (int64, error)
- func (s *CacheStore) GetJSON(key string, target interface{}) error
- func (s *CacheStore) GetNoCopy(key string) (types.DataType, []byte, error)
- func (s *CacheStore) GetRaw(key string) ([]byte, error)
- func (s *CacheStore) GetRawNoCopy(key string) ([]byte, error)
- func (s *CacheStore) GetString(key string) (string, error)
- func (s *CacheStore) GetTime(key string) (time.Time, error)
- func (s *CacheStore) GetUInt16(key string) (uint16, error)
- func (s *CacheStore) GetUInt32(key string) (uint32, error)
- func (s *CacheStore) GetUInt64(key string) (uint64, error)
- func (s *CacheStore) IncrFloat32(key string, delta float32, exp time.Duration) error
- func (s *CacheStore) IncrFloat64(key string, delta float64, exp time.Duration) error
- func (s *CacheStore) IncrInt16(key string, delta int16, exp time.Duration) error
- func (s *CacheStore) IncrInt32(key string, delta int32, exp time.Duration) error
- func (s *CacheStore) IncrInt64(key string, delta int64, exp time.Duration) error
- func (s *CacheStore) IncrUInt16(key string, delta uint16, exp time.Duration) error
- func (s *CacheStore) IncrUInt32(key string, delta uint32, exp time.Duration) error
- func (s *CacheStore) IncrUInt64(key string, delta uint64, exp time.Duration) error
- func (s *CacheStore) IsClosed() bool
- func (s *CacheStore) Keys() []string
- func (s *CacheStore) MDelete(keys ...string) []error
- func (s *CacheStore) MGet(keys ...string) []BatchResult
- func (s *CacheStore) MSet(items ...BatchItem) []error
- func (s *CacheStore) Set(key string, dataType types.DataType, value []byte, expiry time.Duration) error
- func (s *CacheStore) SetBool(key string, value bool, exp time.Duration) error
- func (s *CacheStore) SetFloat32(key string, value float32, exp time.Duration) error
- func (s *CacheStore) SetFloat64(key string, value float64, exp time.Duration) error
- func (s *CacheStore) SetInt16(key string, value int16, exp time.Duration) error
- func (s *CacheStore) SetInt32(key string, value int32, exp time.Duration) error
- func (s *CacheStore) SetInt64(key string, value int64, exp time.Duration) error
- func (s *CacheStore) SetJSON(key string, value interface{}, exp time.Duration) error
- func (s *CacheStore) SetRaw(key string, value []byte, exp time.Duration) error
- func (s *CacheStore) SetString(key string, value string, exp time.Duration) error
- func (s *CacheStore) SetTime(key string, value time.Time, exp time.Duration) error
- func (s *CacheStore) SetUInt16(key string, value uint16, exp time.Duration) error
- func (s *CacheStore) SetUInt32(key string, value uint32, exp time.Duration) error
- func (s *CacheStore) SetUInt64(key string, value uint64, exp time.Duration) error
- func (s *CacheStore) Sync()
- func (s *CacheStore) TTL(key string) time.Duration
- type DirtyAction
Constants ¶
View Source
const ( TTLNoExpiry time.Duration = -1 // Key exists and does not expire TTLExpired time.Duration = -2 // Key does not exist or is expired )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchResult ¶
type CacheStore ¶
type CacheStore struct {
// contains filtered or unexported fields
}
func NewCacheStore ¶
func NewCacheStore(cfg config.Config) (*CacheStore, error)
func (*CacheStore) Close ¶
func (s *CacheStore) Close() error
func (*CacheStore) DecrUInt16 ¶
func (*CacheStore) DecrUInt32 ¶
func (*CacheStore) DecrUInt64 ¶
func (*CacheStore) Delete ¶
func (s *CacheStore) Delete(key string) error
func (*CacheStore) Exists ¶
func (s *CacheStore) Exists(keys ...string) int
func (*CacheStore) Flush ¶
func (s *CacheStore) Flush()
func (*CacheStore) FullSync ¶
func (s *CacheStore) FullSync()
func (*CacheStore) GetFloat32 ¶
func (s *CacheStore) GetFloat32(key string) (float32, error)
func (*CacheStore) GetFloat64 ¶
func (s *CacheStore) GetFloat64(key string) (float64, error)
func (*CacheStore) GetJSON ¶
func (s *CacheStore) GetJSON(key string, target interface{}) error
func (*CacheStore) GetNoCopy ¶
⚠️ WARNING: GetNoCopy returns a reference to internal cache data.
In contrast to the standard Get() method, which returns a **safe copy**,
GetNoCopy is designed for performance-critical scenarios where copying is avoided. However, modifying the returned value may cause unexpected behavior in concurrent environments.
✅ If you don't explicitly need zero-copy performance,
use Get() to avoid race conditions and data corruption.
func (*CacheStore) GetRawNoCopy ¶
func (s *CacheStore) GetRawNoCopy(key string) ([]byte, error)
func (*CacheStore) IncrFloat32 ¶
func (*CacheStore) IncrFloat64 ¶
func (*CacheStore) IncrUInt16 ¶
func (*CacheStore) IncrUInt32 ¶
func (*CacheStore) IncrUInt64 ¶
func (*CacheStore) IsClosed ¶
func (s *CacheStore) IsClosed() bool
func (*CacheStore) Keys ¶
func (s *CacheStore) Keys() []string
func (*CacheStore) MDelete ¶
func (s *CacheStore) MDelete(keys ...string) []error
func (*CacheStore) MGet ¶
func (s *CacheStore) MGet(keys ...string) []BatchResult
func (*CacheStore) MSet ¶
func (s *CacheStore) MSet(items ...BatchItem) []error
func (*CacheStore) SetFloat32 ¶
func (*CacheStore) SetFloat64 ¶
func (*CacheStore) SetJSON ¶
func (s *CacheStore) SetJSON(key string, value interface{}, exp time.Duration) error
func (*CacheStore) Sync ¶
func (s *CacheStore) Sync()
Click to show internal directories.
Click to hide internal directories.