Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/massivefermion/radish

A Redis client for Gleam
https://github.com/massivefermion/radish

Last synced: about 2 months ago
JSON representation

A Redis client for Gleam

Awesome Lists containing this project

README

        

![radish](https://raw.githubusercontent.com/massivefermion/radish/main/banner.jpg)

[![Package Version](https://img.shields.io/hexpm/v/radish)](https://hex.pm/packages/radish)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/radish/)

# radish

A Gleam client for Valkey, KeyDB, Redis and other tools with compatible APIs

## Quick start

```sh
gleam test # Run the tests
gleam shell # Run an Erlang shell
```

## Installation

```sh
gleam add radish
```

## Usage

```gleam
import radish
import radish/list

pub fn main() {
let assert Ok(client) =
radish.start(
"localhost",
6379,
[radish.Timeout(128), radish.Auth("password")],
)

radish.set(client, "requests", "64", 128)
radish.expire(client, "requests", 60, 128)
radish.decr(client, "requests", 128)

list.lpush(
client,
"names",
["Gary", "Andy", "Nicholas", "Danny", "Shaun", "Ed"],
128,
)
list.lpop(client, "names", 128)
}
```