An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          



GitHub Actions CI Status
GitHub Actions CodeQL Status
Coverage Status

Usage exampleCI StatusLicense


`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` | [![CI](https://kaos.sh/w/redy/ci.svg?branch=master)](https://kaos.sh/w/redy/ci?query=branch:master) |
| `develop` | [![CI](https://kaos.sh/w/redy/ci.svg?branch=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)