Categorygithub.com/redis-go/redis
modulepackage
0.0.0-20190129163758-e7bb29b08926
Repository: https://github.com/redis-go/redis.git
Documentation: pkg.go.dev

# README


Becoming a full Redis implementation in Go

This project started to see how easy it is to implement a full Redis clone in Go. As one of the side effects, imagine you could write redis modules in Go, that would be awesome!

Get involved!

This project is in work-in-progress, so share ideas, code and have fun.

The goal is to have all features and commands like the actual redis written in C have. We are searching contributors!

Documentation

godoc: https://godoc.org/github.com/redis-go/redis

Getting Started

You can already test out the API.

To install, run:

go get -u github.com/redis-go/redis

Roadmap

  • Client connection / request / respond
  • RESP protocol
  • able to register commands
  • in-mem database
  • active key expirer
  • Implementing data structures
    • String
    • List
    • Set
    • Sorted Set
    • Hash
    • ...
  • Tests
    • For existing commands
    • For key expirer
  • Alpha Release

TODO beside Roadmap

  • Persistence
  • Redis config
    • Default redis config format
    • YAML support
    • Json support
  • Pub/Sub
  • Redis modules
  • Benchmarks
  • master slaves
  • cluster
  • ...

# Packages

No description provided by the author

# Functions

Default redis server.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewRedisDb creates a new db.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Run runs the default redis server.
SET key value [NX] [XX] [EX <seconds>] [PX <milliseconds>].
TimeExpired check if a timestamp is older than now.
No description provided by the author

# Constants

"a" flag */.
"k" flag */.
"m" flag */.
"F" flag */.
"l" flag */.
Command exported by module.
Use the modules getkeys interface.
Deny on Redis Cluster.
"s" flag */.
"p" flag */.
"R" flag */.
"r" flag */.
"M" flag */.
"S" flag */.
"t" flag */.
"w" flag */.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

A connected Client.
A command can be registered.
No description provided by the author
No description provided by the author
This is the redis server.
A redis database.
No description provided by the author

# Interfaces

The item interface.
No description provided by the author

# Type aliases

Accept is called when a Client tries to connect and before everything else, the Client connection will be closed instantaneously if the function returns false.
Client id.
Client map.
Command flag type.
The CommandHandler is triggered when the received command equals a registered command.
Commands map.
Database id.
Keys with expire timestamp.
A Handler is called when a request is received and after Accept (if Accept allowed the connection by returning true).
Key-Item map.
OnClose is called when a Client connection is closed.
Redis databases map.
Is called when a request is received, after Accept and if the command is not registered.