Documentation
¶
Overview ¶
Package sharedtest is a small in-process stand-in for a Valkey or Redis server, for tests of code that talks to one. It speaks just enough RESP: AUTH, PING, SET (NX, PX), GET and DEL, with expiry on a clock the test moves by hand.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// Addr is host:port to connect to.
Addr string
// contains filtered or unexported fields
}
Server is a fake Valkey listening on loopback.
func Start ¶
Start launches a server that asks for password when it is not empty. It stops when the test ends.
func (*Server) Connections ¶
Connections is how many client connections have been accepted so far.
func (*Server) DropConnections ¶
func (s *Server) DropConnections()
DropConnections closes every client connection but keeps listening, as a restart of a proxy or an idle timeout would.
Click to show internal directories.
Click to hide internal directories.