Documentation ¶
Overview ¶
Package mock implements mocks for various runtime services
Index ¶
- type RedisCache
- func (cache *RedisCache) Connect() error
- func (cache *RedisCache) Delete(key string) error
- func (cache *RedisCache) Disconnect() error
- func (cache *RedisCache) GetFloat64(key string) (float64, error)
- func (cache *RedisCache) IncrementBy(key string, value int64) error
- func (cache *RedisCache) Set(key string, value interface{}) error
- type RedisQueue
- func (queue *RedisQueue) Connect() error
- func (queue *RedisQueue) CountItems(key string) (int, error)
- func (queue *RedisQueue) Disconnect() error
- func (queue *RedisQueue) Fetch(key string) ([]byte, error)
- func (queue *RedisQueue) FetchMany(key string, count int) ([][]byte, error)
- func (queue *RedisQueue) Purge(key string) error
- func (queue *RedisQueue) Push(key string, data []byte) error
- func (queue *RedisQueue) PushMany(key string, data [][]byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
RedisCache implements a mock Redis cache using keys
func NewRedisCache ¶
func NewRedisCache() (*RedisCache, error)
NewRedisCache creates a new instance of the Redis mock queue endpoint is the full URL of the Redis endpoint database is the Redis database to use queue is the name of the Redis key to keep the list at
func (*RedisCache) Disconnect ¶
func (cache *RedisCache) Disconnect() error
Disconnect from a Redis instance
func (*RedisCache) GetFloat64 ¶
func (cache *RedisCache) GetFloat64(key string) (float64, error)
Get an float value at key
func (*RedisCache) IncrementBy ¶
func (cache *RedisCache) IncrementBy(key string, value int64) error
IncrementBy increments the value at key by the given value
func (*RedisCache) Set ¶
func (cache *RedisCache) Set(key string, value interface{}) error
Set a float value at key
type RedisQueue ¶
type RedisQueue struct {
// contains filtered or unexported fields
}
RedisQueue implements a mock Redis queue using the LIST datastructure that match the queuer inerface
func NewRedisQueue ¶
func NewRedisQueue() (*RedisQueue, error)
NewRedisQueue creates a new instance of the Redis mock queue endpoint is the full URL of the Redis endpoint database is the Redis database to use queue is the name of the Redis key to keep the list at
func (*RedisQueue) CountItems ¶
func (queue *RedisQueue) CountItems(key string) (int, error)
CountItems counts the amount of items in the given queue
func (*RedisQueue) Disconnect ¶
func (queue *RedisQueue) Disconnect() error
Disconnect from a Redis instance
func (*RedisQueue) Fetch ¶
func (queue *RedisQueue) Fetch(key string) ([]byte, error)
Fetch retrieves a single item from the Redis list at key and returns a byte slice of data
func (*RedisQueue) FetchMany ¶
func (queue *RedisQueue) FetchMany(key string, count int) ([][]byte, error)
FetchMany retrieves multiple items from the Redis list at key and returns a list of byte slices up to count
func (*RedisQueue) Purge ¶
func (queue *RedisQueue) Purge(key string) error
Purge all items from the given queue