Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sudohikumar/redis-client
Simple Redis API for CRUD operation.
https://github.com/sudohikumar/redis-client
api go golang redis
Last synced: 1 day ago
JSON representation
Simple Redis API for CRUD operation.
- Host: GitHub
- URL: https://github.com/sudohikumar/redis-client
- Owner: sudohikumar
- Created: 2020-11-10T14:16:09.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-14T06:48:46.000Z (about 4 years ago)
- Last Synced: 2023-07-10T10:09:37.905Z (over 1 year ago)
- Topics: api, go, golang, redis
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Setup
- Imports
```go
import (
"github.com/justsimplify/redis-client/module"
"github.com/justsimplify/redis-client/modules/redis"
)
```
### Usage
- Create a redis client
```go
rc := redis.Client{
Host: ,
Port: ,
Password: ,
}
```- READ operation
```go
rc.Read(ctx context.Context, redisKey string)
```- DELETE operation
```go
rc.Delete(ctx context.Context, redisKey string)
```- CREATE operation
```go
payload := modules.RedisPayload{
Key: "redis-key",
Value: "redis-value",
}
rc.Create(ctx context.Context, payload modules.RedisPayload)
```- UPDATE operation
```go
payload := modules.RedisPayload{
Key: "redis-key",
Value: "redis-value",
}
rc.Update(ctx context.Context, payload modules.RedisPayload)
```