Documentation
¶
Index ¶
- type FileStore
- func (s *FileStore) Decrement(key string, value int64) (int64, error)
- func (s *FileStore) Flush() error
- func (s *FileStore) Forever(key string, value interface{}) error
- func (s *FileStore) Forget(key string) error
- func (s *FileStore) Get(key string) (interface{}, bool)
- func (s *FileStore) GetPrefix() string
- func (s *FileStore) GetString(key string) (string, bool)
- func (s *FileStore) Has(key string) bool
- func (s *FileStore) Increment(key string, value int64) (int64, error)
- func (s *FileStore) Many(keys []string) map[string]interface{}
- func (s *FileStore) Put(key string, value interface{}, ttl time.Duration) error
- func (s *FileStore) PutMany(items map[string]interface{}, ttl time.Duration) error
- func (s *FileStore) Remember(key string, ttl time.Duration, callback func() interface{}) (interface{}, error)
- func (s *FileStore) RememberForever(key string, callback func() interface{}) (interface{}, error)
- type MemoryStore
- func (s *MemoryStore) Close()
- func (s *MemoryStore) Decrement(key string, value int64) (int64, error)
- func (s *MemoryStore) Flush() error
- func (s *MemoryStore) Forever(key string, value interface{}) error
- func (s *MemoryStore) Forget(key string) error
- func (s *MemoryStore) Get(key string) (interface{}, bool)
- func (s *MemoryStore) GetPrefix() string
- func (s *MemoryStore) GetString(key string) (string, bool)
- func (s *MemoryStore) Has(key string) bool
- func (s *MemoryStore) Increment(key string, value int64) (int64, error)
- func (s *MemoryStore) Many(keys []string) map[string]interface{}
- func (s *MemoryStore) Put(key string, value interface{}, ttl time.Duration) error
- func (s *MemoryStore) PutMany(items map[string]interface{}, ttl time.Duration) error
- func (s *MemoryStore) Remember(key string, ttl time.Duration, callback func() interface{}) (interface{}, error)
- func (s *MemoryStore) RememberForever(key string, callback func() interface{}) (interface{}, error)
- type RedisStore
- func (s *RedisStore) Decrement(key string, value int64) (int64, error)
- func (s *RedisStore) Flush() error
- func (s *RedisStore) Forever(key string, value interface{}) error
- func (s *RedisStore) Forget(key string) error
- func (s *RedisStore) Get(key string) (interface{}, bool)
- func (s *RedisStore) GetPrefix() string
- func (s *RedisStore) GetString(key string) (string, bool)
- func (s *RedisStore) Has(key string) bool
- func (s *RedisStore) Increment(key string, value int64) (int64, error)
- func (s *RedisStore) Many(keys []string) map[string]interface{}
- func (s *RedisStore) Put(key string, value interface{}, ttl time.Duration) error
- func (s *RedisStore) PutMany(items map[string]interface{}, ttl time.Duration) error
- func (s *RedisStore) Remember(key string, ttl time.Duration, callback func() interface{}) (interface{}, error)
- func (s *RedisStore) RememberForever(key string, callback func() interface{}) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
FileStore implements a file-based cache store
func NewFileStore ¶
NewFileStore creates a new file cache store
func (*FileStore) Remember ¶
func (s *FileStore) Remember(key string, ttl time.Duration, callback func() interface{}) (interface{}, error)
Remember gets from cache or computes and stores
func (*FileStore) RememberForever ¶
RememberForever gets from cache or computes and stores forever
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore implements an in-memory cache store
func NewMemoryStore ¶
func NewMemoryStore(prefix string) *MemoryStore
NewMemoryStore creates a new memory cache store
func (*MemoryStore) Decrement ¶
func (s *MemoryStore) Decrement(key string, value int64) (int64, error)
Decrement decrements a numeric value
func (*MemoryStore) Flush ¶
func (s *MemoryStore) Flush() error
Flush removes all values from the cache
func (*MemoryStore) Forever ¶
func (s *MemoryStore) Forever(key string, value interface{}) error
Forever stores a value in the cache indefinitely
func (*MemoryStore) Forget ¶
func (s *MemoryStore) Forget(key string) error
Forget removes a value from the cache
func (*MemoryStore) Get ¶
func (s *MemoryStore) Get(key string) (interface{}, bool)
Get retrieves a value from the cache
func (*MemoryStore) GetPrefix ¶
func (s *MemoryStore) GetPrefix() string
GetPrefix returns the cache prefix
func (*MemoryStore) GetString ¶
func (s *MemoryStore) GetString(key string) (string, bool)
GetString retrieves a string value from the cache
func (*MemoryStore) Increment ¶
func (s *MemoryStore) Increment(key string, value int64) (int64, error)
Increment increments a numeric value
func (*MemoryStore) Many ¶
func (s *MemoryStore) Many(keys []string) map[string]interface{}
Many retrieves multiple values
func (*MemoryStore) Put ¶
func (s *MemoryStore) Put(key string, value interface{}, ttl time.Duration) error
Put stores a value in the cache with a TTL
func (*MemoryStore) PutMany ¶
func (s *MemoryStore) PutMany(items map[string]interface{}, ttl time.Duration) error
PutMany stores multiple values
func (*MemoryStore) Remember ¶
func (s *MemoryStore) Remember(key string, ttl time.Duration, callback func() interface{}) (interface{}, error)
Remember gets from cache or computes and stores
func (*MemoryStore) RememberForever ¶
func (s *MemoryStore) RememberForever(key string, callback func() interface{}) (interface{}, error)
RememberForever gets from cache or computes and stores forever
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
RedisStore implements a Redis-based cache store (stub for now)
func NewRedisStore ¶
func NewRedisStore(prefix string, host string, port int, password string, database int) (*RedisStore, error)
NewRedisStore creates a new Redis cache store
func (*RedisStore) Decrement ¶
func (s *RedisStore) Decrement(key string, value int64) (int64, error)
func (*RedisStore) Flush ¶
func (s *RedisStore) Flush() error
func (*RedisStore) Forever ¶
func (s *RedisStore) Forever(key string, value interface{}) error
func (*RedisStore) Forget ¶
func (s *RedisStore) Forget(key string) error
func (*RedisStore) Get ¶
func (s *RedisStore) Get(key string) (interface{}, bool)
func (*RedisStore) GetPrefix ¶
func (s *RedisStore) GetPrefix() string
func (*RedisStore) Has ¶
func (s *RedisStore) Has(key string) bool
func (*RedisStore) Increment ¶
func (s *RedisStore) Increment(key string, value int64) (int64, error)
func (*RedisStore) Many ¶
func (s *RedisStore) Many(keys []string) map[string]interface{}
func (*RedisStore) Put ¶
func (s *RedisStore) Put(key string, value interface{}, ttl time.Duration) error
func (*RedisStore) PutMany ¶
func (s *RedisStore) PutMany(items map[string]interface{}, ttl time.Duration) error
func (*RedisStore) Remember ¶
func (s *RedisStore) Remember(key string, ttl time.Duration, callback func() interface{}) (interface{}, error)
func (*RedisStore) RememberForever ¶
func (s *RedisStore) RememberForever(key string, callback func() interface{}) (interface{}, error)