Skip to content

jollyboss123/pegasus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pegasus

pegasus is a naive Java implementation of a Redis server that can be connected to using the Jedis client.

Installation and Setup

  1. Clone the repository:

    git clone https://github.com/your-username/pegasus.git
  2. Build the project using maven:

    cd j-redis
    mvn clean package
  3. Run the pegasus server

    java -jar target/j-redis.jar

Usage

Using Jedis Client

You can connect to the j-redis server using the Jedis client as follows:

try (Jedis jedis = new Jedis("localhost", <port>)) {
    jedis.set("hello", "world");
    String value = jedis.get("hello");
    jedis.get("nonexistent");
}

Sending Commands Manually

Alternatively, you can send Redis commands manually:

Set Command

printf "*3\r\n\$3\r\nSET\r\n\$5\r\nhello\r\n\$5\r\nworld\r\n" | nc localhost <port>

Get Command

printf "*3\r\n\$3\r\nGET\r\n\$5\r\nhello\r\n" | nc localhost <port>

About

a naive java implementation of a redis server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages