Fast and simple in-memory cache tool
rcache is a command-line based key-value cache tool with TTL (Time To Live) support. Implemented in Go, it provides fast and concurrency-safe operations.
- 🚀 Fast in-memory cache
- ⏱️ TTL (Time To Live) support
- 🔒 Concurrency-safe operations
- 📝 Simple CLI interface
- 🧪 Comprehensive test coverage
git clone https://github.com/rRateLimit/rcache.git
cd rcache
make build
go install github.com/rRateLimit/rcache/cmd/rcache@latest
# Basic set
rcache set mykey "Hello, World!"
# Set with TTL (expires after 10 seconds)
rcache set mykey "Hello, World!" --ttl 10s
# TTL can be specified in seconds (s), minutes (m), or hours (h)
rcache set mykey "Hello, World!" --ttl 5m
rcache set mykey "Hello, World!" --ttl 1h
rcache get mykey
# Output: Hello, World!
rcache delete mykey
# Output: Deleted: mykey
rcache list
# Output as JSON
rcache list --json
rcache size
# Output: Cache size: 3
rcache clear
# Output: Cache cleared
- Go 1.21 or higher
make build
make test
make fmt
make all
rcache/
├── cmd/
│ └── rcache/
│ └── main.go # Main entry point
├── internal/
│ ├── cache/
│ │ ├── cache.go # Cache core implementation
│ │ └── cache_test.go # Cache tests
│ └── cli/
│ ├── commands.go # CLI command implementation
│ └── commands_test.go # CLI tests
├── go.mod
├── go.sum
├── Makefile
└── README.md
MIT License
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
rRateLimit