Documentation ¶
Index ¶
- func NewCache(url *url.URL) (cache.Cache, error)
- type MemoryCache
- func (m *MemoryCache) Close() error
- func (m *MemoryCache) Delete(ctx context.Context, key string, opts ...cache.DeleteOptions) error
- func (m *MemoryCache) Exist(ctx context.Context, key string) bool
- func (m *MemoryCache) Get(ctx context.Context, key string) ([]byte, error)
- func (m *MemoryCache) GetFloat(ctx context.Context, key string) (float64, error)
- func (m *MemoryCache) GetInt(ctx context.Context, key string) (int64, error)
- func (m *MemoryCache) GetKeys(ctx context.Context, pattern string) []string
- func (m *MemoryCache) GetObject(ctx context.Context, key string, doc interface{}) error
- func (m *MemoryCache) GetString(ctx context.Context, key string) (string, error)
- func (m *MemoryCache) Increment(ctx context.Context, key string, expiration int) (int64, error)
- func (m *MemoryCache) RemainingTime(ctx context.Context, key string) int
- func (m *MemoryCache) Set(ctx context.Context, key string, value interface{}, expiration int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
MemoryCache memory cache object
func (*MemoryCache) Delete ¶
func (m *MemoryCache) Delete(ctx context.Context, key string, opts ...cache.DeleteOptions) error
Delete delete record
func (*MemoryCache) Exist ¶
func (m *MemoryCache) Exist(ctx context.Context, key string) bool
Exist check if key exist
func (*MemoryCache) GetKeys ¶
func (m *MemoryCache) GetKeys(ctx context.Context, pattern string) []string
func (*MemoryCache) GetObject ¶
func (m *MemoryCache) GetObject(ctx context.Context, key string, doc interface{}) error
GetObject get value in object
func (*MemoryCache) RemainingTime ¶
func (m *MemoryCache) RemainingTime(ctx context.Context, key string) int
RemainingTime get remainig time
Click to show internal directories.
Click to hide internal directories.