handle redis password (#87)

*  handle redis password

* 🍱 fix version
This commit is contained in:
maxlerebourg
2023-03-04 11:51:54 +01:00
committed by GitHub
parent b079073ff6
commit 50690d1ac7
8 changed files with 86 additions and 29 deletions
+28 -1
View File
@@ -1,2 +1,29 @@
# simpleredis
Minimal go redis with only get, set and delete operation
Minimal go redis with only `get`, `set` and `delete` operation.
With **NO** extern dependencies.
## Example
```go
import simpleredis "github.com/maxlerebourg/simpleredis"
var redis simpleredis.SimpleRedis
redis.Init("redis:6379", "") // redisHost, redisPass
err := redis.Set("test", []bytes("whatever"), 60), // Set key "test" with "whatever" for 60 seconds
if err != nil {
...
}
val, err := redis.Get("test") // get key test
if err != nil {
// err could be only redis:unreachable, redis:miss or redis:timeout available in simpleredis.RedisUnreachable
...
}
err = redis.Del("test")
if err != nil {
...
}
```
## Author
Max Lerebourg @ [Primadviz.com](https://primadviz.com)