https://github.com/essentialkaos/redy
Tiny Redis client for Go
https://github.com/essentialkaos/redy
golang library redis
Last synced: 12 months ago
JSON representation
Tiny Redis client for Go
- Host: GitHub
- URL: https://github.com/essentialkaos/redy
- Owner: essentialkaos
- License: mit
- Created: 2018-05-23T12:11:48.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-17T08:01:43.000Z (over 1 year ago)
- Last Synced: 2024-10-19T10:48:51.452Z (over 1 year ago)
- Topics: golang, library, redis
- Language: Go
- Homepage: https://kaos.sh/g/redy.v4
- Size: 168 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
Usage example • CI Status • License
`redy` is a tiny Redis client based on [radix.v2](https://github.com/mediocregopher/radix.v2) code base.
### Usage example
```go
package main
import (
"fmt"
"time"
"github.com/essentialkaos/redy/v4"
)
func main() {
rc := redy.Client{
Network: "tcp",
Addr: "127.0.0.1:6379",
DialTimeout: 15 * time.Second,
}
err := rc.Connect()
if err != nil {
fmt.Printf("Connection error: %v\n", err)
return
}
r := rc.Cmd("SET", "ABC", 1)
if r.Err != nil {
fmt.Printf("Command error: %v\n", r.Err)
return
}
r = rc.Cmd("GET", "ABC")
if r.Err != nil {
fmt.Printf("Command error: %v\n", r.Err)
return
}
val, err := r.Int()
if err != nil {
fmt.Printf("Parsing error: %v\n", err)
return
}
fmt.Printf("ABC → %d\n", val)
}
```
### CI Status
| Branch | Status |
|------------|--------|
| `master` | [](https://kaos.sh/w/redy/ci?query=branch:master) |
| `develop` | [](https://kaos.sh/w/redy/ci?query=branch:develop) |
### Contributing
Before contributing to this project please read our [Contributing Guidelines](https://github.com/essentialkaos/.github/blob/master/CONTRIBUTING.md).
### License
[MIT](LICENSE)