memcached

package
v0.0.0-...-bea4ea4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2016 License: MIT, AGPL-3.0-or-later Imports: 2 Imported by: 0

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

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

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

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