Documentation ¶
Overview ¶
Useful functions for building your own memcached server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleIO ¶
func HandleIO(s io.ReadWriteCloser, handler RequestHandler) error
Handle until the handler returns a fatal message or a read or write on the socket fails.
func HandleMessage ¶
Handle an individual message.
func ReadPacket ¶
func ReadPacket(r io.Reader) (rv gomemcached.MCRequest, err error)
Types ¶
type RequestHandler ¶
type RequestHandler interface { // Handle a message from the client. // If the message should cause the connection to terminate, // the Fatal flag should be set. If the message requires no // response, return nil // // Most clients should ignore the io.Writer unless they want // complete control over the response. HandleMessage(io.Writer, *gomemcached.MCRequest) *gomemcached.MCResponse }
Request handler for doing server stuff.
func FuncHandler ¶
func FuncHandler(f func(io.Writer, *gomemcached.MCRequest) *gomemcached.MCResponse) RequestHandler
Convert a request handler function as a RequestHandler.
Click to show internal directories.
Click to hide internal directories.