Documentation
¶
Index ¶
- Constants
- Variables
- type GoCacheClientInterface
- type GoCacheStore
- func (s *GoCacheStore) Clear() error
- func (s *GoCacheStore) Delete(key interface{}) error
- func (s *GoCacheStore) Get(key interface{}) (interface{}, error)
- func (g *GoCacheStore) GetType() string
- func (s *GoCacheStore) GetWithTTL(key interface{}) (interface{}, time.Duration, error)
- func (s *GoCacheStore) Set(key interface{}, value interface{}, expiration time.Duration) error
- type Options
- type RedisClientInterface
- type RedisStore
- func (s *RedisStore) Clear() error
- func (s *RedisStore) Delete(key interface{}) error
- func (s *RedisStore) Get(key interface{}) (interface{}, error)
- func (s *RedisStore) GetType() string
- func (s *RedisStore) GetWithTTL(key interface{}) (interface{}, time.Duration, error)
- func (s *RedisStore) Set(key interface{}, val interface{}, expiration time.Duration) error
- type StoreInterface
Constants ¶
View Source
const GoCacheType = "go-cache"
View Source
const RedisType = "redis"
Variables ¶
View Source
var (
ErrValueNotFound = errors.New("value not found")
)
Functions ¶
This section is empty.
Types ¶
type GoCacheClientInterface ¶
type GoCacheClientInterface interface {
Get(k string) (interface{}, bool)
GetWithExpiration(k string) (interface{}, time.Time, bool)
Set(k string, x interface{}, d time.Duration)
Delete(k string)
Flush()
}
GoCacheClientInterface represents a github.com/patrickmn/go-cache client
type GoCacheStore ¶
type GoCacheStore struct {
// contains filtered or unexported fields
}
func NewGoCache ¶
func NewGoCache(client GoCacheClientInterface, options *Options) *GoCacheStore
func (*GoCacheStore) Clear ¶
func (s *GoCacheStore) Clear() error
func (*GoCacheStore) Delete ¶
func (s *GoCacheStore) Delete(key interface{}) error
func (*GoCacheStore) Get ¶
func (s *GoCacheStore) Get(key interface{}) (interface{}, error)
func (*GoCacheStore) GetType ¶
func (g *GoCacheStore) GetType() string
func (*GoCacheStore) GetWithTTL ¶
func (s *GoCacheStore) GetWithTTL(key interface{}) (interface{}, time.Duration, error)
type RedisClientInterface ¶
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
func NewRedis ¶
func NewRedis(client RedisClientInterface, options *Options) *RedisStore
func (*RedisStore) Clear ¶
func (s *RedisStore) Clear() error
func (*RedisStore) Delete ¶
func (s *RedisStore) Delete(key interface{}) error
func (*RedisStore) Get ¶
func (s *RedisStore) Get(key interface{}) (interface{}, error)
func (*RedisStore) GetType ¶
func (s *RedisStore) GetType() string
func (*RedisStore) GetWithTTL ¶
func (s *RedisStore) GetWithTTL(key interface{}) (interface{}, time.Duration, error)
Click to show internal directories.
Click to hide internal directories.