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

https://github.com/betterstack-community/go-redis

Examples for using Redis in Go programs
https://github.com/betterstack-community/go-redis

Last synced: 27 days ago
JSON representation

Examples for using Redis in Go programs

Awesome Lists containing this project

README

          

# Using Redis in Go

This repo contains various examples of using Redis in Go. You'll learn how to
perform the following actions:

- Connect to a Redis server from your Go program.
- Add data to a Redis database.
- Read previously cached data in the database.
- Update a cached value.
- Delete a cached value.

**Tutorial**:
[Redis Caching in Go: A Beginner's Guide](https://betterstack.com/community/guides/scaling-go/redis-in-go/).

## 🟢 Prerequisites

- [A recent version of Go](https://go.dev/doc/install). All examples were tested
with Go v1.21.
- [A recent version of Redis](https://redis.io/docs/getting-started/installation/).

## 📦 Getting started

- Clone this repository to your computer and `cd` into it:

```bash
git clone https://github.com/betterstack-community/go-redis.git
cd go-redis/
```

- Install the required dependencies:

```bash
go mod download
```

- Follow along with the
[tutorial](https://betterstack.com/community/guides/scaling-go/redis-in-go/).

## âš– License

The code used in this project and in the linked tutorial are licensed under the
[Apache License, Version 2.0](LICENSE).