redisgo 0.1.0

package for handling redis in rust more easily
Documentation

RedisGo

RedisGo is a Rust library designed to simplify interactions with Redis, providing a convenient API for common Redis operations such as setting, getting, deleting keys, and more. It leverages the redis crate and includes features like connection management and .env file support for configuration.

Installation

Add the following to your Cargo.toml:

[dependencies]
redis = "*"

Usage

Initialization

Ensure your .env file contains the REDIS_URL variable:

REDIS_URL=redis://127.0.0.1/

Then, initialize the RedisGo singleton:

use redisgo::get_redisgo;

let redisgo = get_redisgo();

Basic Operations

Set a Key

redisgo::set("key", "value")?;

Get a Key

let value = redisgo::get("key")?;

Delete a Key

redisgo::delete("key")?;

Check if a Key Exists

let exists = redisgo::exists("key")?;

Flush All Keys

redisgo::flush_all()?;

Advanced Operations

Set a Key with TTL

redisgo::set_with_ttl("key", "value", Some(60))?; // TTL in seconds

Ping Redis

let response = redisgo.ping()?;

Get Connection Status

let status = redisgo.get_connection_status();

Get Client Info

let info = redisgo.get_client_info();

Rusty Rails Project

Rusty Rails is a larger project aiming to bridge the gap between Rust and Ruby/Ruby on Rails. We are actively working on recreating Ruby libraries into Rust that seamlessly make working in Rust more easy and fun for new developers.

Contributing

Contributions to the RedisGo library are welcome! Feel free to open issues, submit pull requests, or provide feedback to help improve this library.