mmc

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BodyFormatError  = errors.New("Invalid body data")
	LineTooLongError = errors.New("Request line too long")
	CloseConnError   = errors.New("Close")
)

Functions

func NewSession

func NewSession(rwc io.ReadWriteCloser, handler Handler)

Types

type Handler

type Handler interface {
	ServeMemcache(*Request, *Response) error
}

type HandlerFunc

type HandlerFunc func(*Request, *Response) error

func (HandlerFunc) ServeMemcache

func (h HandlerFunc) ServeMemcache(req *Request, res *Response) error

type Request

type Request struct {
	Command string
	Args    []string
	// contains filtered or unexported fields
}

func (*Request) ReadBody

func (r *Request) ReadBody(length int) ([]byte, error)

type Response

type Response struct {
	// contains filtered or unexported fields
}

func (*Response) ClientError

func (r *Response) ClientError(msg string) error

func (*Response) ServerError

func (r *Response) ServerError(msg string) error

func (*Response) Status

func (r *Response) Status(status string) error

func (*Response) UnknownCommandError

func (r *Response) UnknownCommandError() error

func (*Response) Value

func (r *Response) Value(key string, body []byte) error

func (*Response) ValueFull

func (r *Response) ValueFull(key string, body []byte, flags uint32, cas uint64) error

Jump to

Keyboard shortcuts

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