Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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.

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)
```