memcached

package
v0.0.0-...-b800c40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package memcached provides 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

HandleIO until the handler returns a fatal message or a read or write on the socket fails.

func HandleMessage

func HandleMessage(r io.Reader, w io.Writer, handler RequestHandler) error

HandleMessage to handle an individual message.

func ReadPacket

func ReadPacket(r io.Reader) (rv transport.MCRequest, err error)

ReadPacket returns a new memcached Request from a reader.

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, *transport.MCRequest) *transport.MCResponse
}

RequestHandler for doing server stuff.

func FuncHandler

FuncHandler to convert a request handler function as a RequestHandler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL