A Redis server implemented in Go.
- Implements the RESP protocol
- Supports basic Redis commands (SET, GET, DEL, etc.)
- Supports multiple databases
- AOF persistence
- Cluster mode
- Go 1.18 or higher
go build -o go-redis.exe main.go
./go-redis
The server can be configured using the redis.conf
file. If the file does not exist, the server will use the default configuration.
The following options can be configured:
bind
: The address to bind to (default:0.0.0.0
)port
: The port to listen on (default:6379
)appendOnly
: Whether to enable AOF persistence (default:false
)appendFilename
: The name of the AOF file (default:appendonly.aof
)databases
: The number of databases (default: 16)
To enable cluster mode, you need to configure the self
and peers
options in the redis.conf
file.
self
: The address of the current nodepeers
: A comma-separated list of addresses of other nodes in the cluster
This project is licensed under the MIT License.