Skip to content

Twahaaa/godis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDIS

A Redis clone built from scratch in Go. Implements a TCP server that speaks the Redis RESP protocol, with a built-in terminal UI client.

GoDIS TUI

Features

  • TCP server listening on port 5001
  • RESP (REdis Serialization Protocol) parsing
  • In-memory key-value store with persistence
  • Key expiry with TTL support (lazy + active cleanup)
  • Concurrent client handling via goroutines
  • Data saved to .godis/godis.json on shutdown and every minute
  • Built-in TUI client with Catppuccin Mocha theme:
    • Ctrl+P command palette with live search
    • Context sidebar (server, session stats, shortcuts, working dir)
    • Scrollable history (mouse wheel / PageUp-Down) with a scrollbar

Supported Commands

Command Description
SET key value [ttl] Store a value, optional TTL in seconds
GET key Retrieve a value
DEL key Delete a key
EXISTS key Check if a key exists
TTL key Get remaining time on a key
EXPIRE key seconds Set or update expiry on a key
KEYS * List all keys

Getting Started

Run the server:

make run

Run the TUI client (in a separate terminal):

make cli

TUI Shortcuts

Key Action
Ctrl+P Open command palette (searchable)
/ Navigate command history
Tab Autocomplete command
Mouse wheel Scroll the history panel
PageUp / PageDown Scroll history a page
Ctrl+U / Ctrl+D Scroll history half a page
Ctrl+L or CLEAR Clear screen
Ctrl+Backspace Delete last word
ESC Quit

Project Structure

godis/
├── main.go          # Server, connection handling, message routing
├── peer.go          # Per-client connection and RESP reading
├── protocol.go      # RESP command parsing
├── keyval.go        # In-memory key-value store
├── client/
│   └── client.go    # Go client library
├── tui/
│   └── tui.go       # Terminal UI (Bubble Tea + Lipgloss)
└── cmd/cli/
    └── main.go      # TUI client entry point

Built With


by TWAHaaa

About

Implementation of Redis KV store in GOLang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors