Documentation
¶
Overview ¶
Package redisstub is a minimal package providing redis-related (in-memory) implementations meant for testing and dev purposes only.
Index ¶
- type InMemoryRedisProvider
- func (rp *InMemoryRedisProvider) Close() error
- func (rp *InMemoryRedisProvider) DataConnection(index int64) (redis.Conn, error)
- func (rp *InMemoryRedisProvider) MetadataConnection() (redis.Conn, error)
- func (rp *InMemoryRedisProvider) SetTemplatePool(template *InMemoryRedisProvider)
- func (rp *InMemoryRedisProvider) TemplateConnection(index int64) (redis.Conn, error)
- type MemoryRedis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryRedisProvider ¶
type InMemoryRedisProvider struct {
// contains filtered or unexported fields
}
InMemoryRedisProvider provides a in memory provider for any redis connection. While it is safe to create this struct directly, it is recommended to create it using NewInMemoryRedisProvider. WARNING: should be used for testing/dev purposes only!
func NewInMemoryRedisProvider ¶
func NewInMemoryRedisProvider(template *InMemoryRedisProvider) *InMemoryRedisProvider
NewInMemoryRedisProvider returns an ARDB Connection Provider, which uses an in-memory ARDB for all its purposes. See documentation for NewMemoryRedis more information. WARNING: should be used for testing/dev purposes only!
func (*InMemoryRedisProvider) Close ¶
func (rp *InMemoryRedisProvider) Close() error
Close implements ConnProvider.Close
func (*InMemoryRedisProvider) DataConnection ¶
func (rp *InMemoryRedisProvider) DataConnection(index int64) (redis.Conn, error)
DataConnection implements ConnProvider.DataConnection
func (*InMemoryRedisProvider) MetadataConnection ¶
func (rp *InMemoryRedisProvider) MetadataConnection() (redis.Conn, error)
MetadataConnection implements ConnProvider.MetadataConnection
func (*InMemoryRedisProvider) SetTemplatePool ¶
func (rp *InMemoryRedisProvider) SetTemplatePool(template *InMemoryRedisProvider)
SetTemplatePool allows you to set the template source for this provider, using the primary source of the given provider. The template source of this provider will be unset in case nil is passed in as an argument.
func (*InMemoryRedisProvider) TemplateConnection ¶
func (rp *InMemoryRedisProvider) TemplateConnection(index int64) (redis.Conn, error)
TemplateConnection implements ConnProvider.TemplateConnection
type MemoryRedis ¶
type MemoryRedis struct {
// contains filtered or unexported fields
}
MemoryRedis is an in memory redis connection implementation
func NewMemoryRedis ¶
func NewMemoryRedis() *MemoryRedis
NewMemoryRedis creates a new in-memory redis stub. It must be noted that the stub only partially redis-compliant, not all commands (such as MULTI/EXEC) are supported. All available commands can be found at: https://github.com/siddontang/ledisdb/blob/master/doc/commands.md WARNING: should be used for testing/dev purposes only!
func (*MemoryRedis) Address ¶
func (mr *MemoryRedis) Address() string
Address returns the tcp (local) address of this MemoryRedis server
func (*MemoryRedis) Close ¶
func (mr *MemoryRedis) Close()
Close the embedded Go Redis Server, and delete the used datadir.
func (*MemoryRedis) Dial ¶
Dial to the embedded Go Redis Server, and return the established connection if possible.
func (*MemoryRedis) Listen ¶
func (mr *MemoryRedis) Listen()
Listen to any incoming TCP requests, and process them in the embedded Go Redis Server.