https://github.com/chronark/upstash-go
https://github.com/chronark/upstash-go
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/chronark/upstash-go
- Owner: chronark
- License: mit
- Created: 2021-11-02T20:51:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-25T05:19:59.000Z (over 3 years ago)
- Last Synced: 2025-04-13T08:11:54.034Z (over 1 year ago)
- Language: Go
- Size: 38.1 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Upstash Redis Go
An HTTP/REST based Redis client built on top of [Upstash REST API](https://docs.upstash.com/features/restapi).
Inspired by [The official typescript client](https://github.com/upstash/upstash-redis)
See [the list of APIs](https://docs.upstash.com/features/restapi#rest---redis-api-compatibility) supported.
[](https://codecov.io/gh/chronark/upstash-go)
## Quick Start
Error handling has been omitted for better readability.
```go
package main
import (
"fmt"
"github.com/chronark/upstash-go"
)
func main() {
// Get your url and token from https://console.upstash.com/redis/{id}
// Or leave empty to load from environment variables
options := upstash.Options{
Url: "", // env: UPSTASH_REDIS_REST_URL
Token: "", // env: UPSTASH_REDIS_REST_TOKEN
}
u, _ := upstash.New(options)
u.Set("foo", "bar")
value, _ := u.Get("foo")
fmt.Println(value)
// -> "bar"
}
```