Documentation ¶
Overview ¶
Package handler defines the mechanics to manipulate request across several redis instances.
It works by mimicking redis, listening for packets over TCP that complies with REdis Serialization Protocol (RESP), and then parsing the Redis command which might be modified before being routed against a real Redis server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
NewServer returns a new instance of *redcon.Server, using Handler as its connection processor. The difference with Run() function is that the server instance is not listening to any address yet, making it useful when you want configure the server before running it.
Types ¶
type ClientConfig ¶
ClientConfig holds the configuration for Redis client
type Handler ¶
type Handler interface { Handle(conn redcon.Conn, cmd redcon.Command) Accept(conn redcon.Conn) bool Closed(conn redcon.Conn, err error) HealthCheck(w http.ResponseWriter, req *http.Request) }
Handler provide set of methods to handle incoming connection.
func NewRedisHandler ¶
func NewRedisHandler(config RedisConfig) Handler
NewRedisHandler returns new instance of redisHandler, a connection handler that handler redis-like interface
type RedisConfig ¶
type RedisConfig struct { Password string DeleteOnGet bool DeleteOnSet bool Source ClientConfig Destination ClientConfig }
RedisConfig holds configuration for initializing redisHandler