memcached

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 2 Imported by: 4

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 gomemcached.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, *gomemcached.MCRequest) *gomemcached.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