# README
GO-YAAF Redis Middleware
This library contains Redis based implementation of the following middleware interfaces:
- The messaging patterns defined by the
IMessageBus
interface of theyaaf-common
library. - Distributed data cache defined by the
IDataCache
interface of theyaaf-common
library.
Installation
Use go get.
go get -v -t github.com/go-yaaf/yaaf-common-redis
Then import the validator package into your own code.
import "github.com/go-yaaf/yaaf-common-redis"
Usage
Use Redis wrapper using a connection string:
- redis://host:port/12
- redis://host:port/db_number
db_number must be in the range of 0 - 15, the default is 0
import (
"fmt"
"time"
. "github.com/go-yaaf/yaaf-common-redis/redis"
. "github.com/go-yaaf/yaaf-common/database"
)
func main() {
uri := "redis://localhost:6379/12"
dc, err := NewRedisDataCache(uri)
if err != nil {
panic(any(err))
}
dc.Ping(5, 5)
}