districache

module
v0.0.0-...-2753770 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2024 License: GPL-3.0

README

DistriCache

DistriCache 🌐 is a proof-of-concept distributed in-memory key/value cache implemented implemented using go. It provides several methods for storing, retrieving and deleting values. DistriCache uses a custom byte based communication protocol over TCP.

Features

  • 📦 Key/Value data storage
  • 🎚️ SET, GET and DEL operations
  • ⏰ Optional TTL for Keys.
  • 🖥️ Leader - Follower model
  • 🤖 Core functions tested

Running

Start the server with the following command

make server

Run a test client

make client

Running test

make test

Running test + benchmark

make bench

Methods

The methods that are available over TCP

SET

Command for inserting values into the cache

SET key value [ttl]
Options

TTL - how long a key/value pair is valid before it's deleted. The TTL is specified in milliseconds. Default value is 0 -> no expiration

Response

OK, the request was successful

GET

Command for retrieving values from the cache

GET key
Response

value, the request was successful (nil), no key found

DEL

Command for deleting values in the cache

DEL key
Response

OK, the request was successful.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL