memcache

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemcacheMagicRequest  = 0x80
	MemcacheMagicResponse = 0x81
)
View Source
const (
	MemcacheUnknownType commandTypeCode = iota
	MemcacheLoadMsg
	MemcacheStoreMsg
	MemcacheDeleteMsg
	MemcacheCounterMsg
	MemcacheInfoMsg
	MemcacheSlabCtrlMsg
	MemcacheLruCrawlerMsg
	MemcacheStatsMsg
	MemcacheSuccessResp
	MemcacheFailResp
	MemcacheAuthMsg
)
View Source
const (
	MemcacheCmdUNKNOWN commandCode = iota
	MemcacheCmdNoOp
	MemcacheCmdSet
	MemcacheCmdAdd
	MemcacheCmdReplace
	MemcacheCmdAppend
	MemcacheCmdPrepend
	MemcacheCmdCas

	MemcacheCmdGet
	MemcacheCmdGets

	MemcacheCmdIncr
	MemcacheCmdDecr
	MemcacheResCounterOp

	MemcacheCmdTouch

	MemcacheCmdDelete

	MemcacheCmdSlabs
	MemcacheCmdSlabsReassign
	MemcacheCmdSlabsAutomove

	MemcacheCmdLru
	MemcacheCmdLruEnable
	MemcacheCmdLruDisable
	MemcacheCmdLruSleep
	MemcacheCmdLruToCrawl
	MemcacheCmdLruCrawl

	MemcacheCmdStats
	MemcacheResStat

	MemcacheCmdFlushAll
	MemcacheCmdVerbosity
	MemcacheCmdQuit
	MemcacheCmdVersion

	MemcacheCmdSaslList
	MemcacheCmdSaslAuth
	MemcacheCmdSaslStep

	MemcacheResOK
	MemcacheResValue
	MemcacheResEnd

	MemcacheResStored
	MemcacheResNotStored
	MemcacheResExists
	MemcacheResNotFound

	MemcacheResTouched

	MemcacheResDeleted

	MemcacheErrError
	MemcacheErrClientError
	MemcacheErrServerError
	MemcacheErrBusy
	MemcacheErrBadClass
	MemcacheErrNoSpare
	MemcacheErrNotFull
	MemcacheErrUnsafe
	MemcacheErrSame

	MemcacheResVersion
)

Variables

View Source
var (
	ErrParserCaughtInError  = errors.New("memcache parser caught in error loop")
	ErrParserUnknownCommand = errors.New("unknown memcache command found")
	ErrNoMoreArgument       = errors.New("no more command arguments")
	ErrExpectedNumber       = errors.New("expected number value")
	ErrExpectedNoReply      = errors.New("expected noreply in argument list")
	ErrExpectedCRLF         = errors.New("expected CRLF")
	ErrExpectedKeys         = errors.New("message has no keys")
)

memcache text parser errors

View Source
var (
	ErrInvalidMemcacheMagic = errors.New("invalid memcache magic number")
	ErrLen                  = errors.New("length field error")
)

memcache binary parser errors

View Source
var (
	ErrInvalidMessage             = errors.New("message is invalid")
	ErrMixOfBinaryAndText         = errors.New("mix of binary and text in one connection")
	ErrResponseUnknownTransaction = errors.New("response from unknown transaction")
	ErrExpectedValueForMerge      = errors.New("expected value to merge with")
	ErrExpectedStatsForMerge      = errors.New("expected stat respose to merge with")
)

memcache transaction/message errors

View Source
var (
	NoteRequestPacketLoss    = "Packet loss while capturing the request"
	NoteResponsePacketLoss   = "Packet loss while capturing the response"
	NoteTransactionNoRequ    = "Invalid transaction. Request missing"
	NoteNonQuietResponseOnly = "Missing response for non-quiet request"
	NoteTransUnfinished      = "Unfinished transaction"
)

internal notes to be published with transaction

View Source
var (
	ErrNotImplemented = errors.New("not implemented")
)
View Source
var (
	ErrUdpIncompleteMessage = errors.New("attempt to parse incomplete message failed")
)

memcache UDP errors

Functions

This section is empty.

Types

type Memcache

type Memcache struct {
	Ports protos.PortsConfig
	// contains filtered or unexported fields
}

memcache types

func (*Memcache) ConnectionTimeout

func (mc *Memcache) ConnectionTimeout() time.Duration

func (*Memcache) GapInStream

func (mc *Memcache) GapInStream(
	tcptuple *common.TcpTuple,
	dir uint8, nbytes int,
	private protos.ProtocolData,
) (priv protos.ProtocolData, drop bool)

GapInStream is called by TCP layer when a packets are missing from the tcp stream.

func (*Memcache) GetPorts

func (mc *Memcache) GetPorts() []int

GetPorts return the configured memcache application ports.

func (*Memcache) Init

func (mc *Memcache) Init(testMode bool, results publish.Transactions) error

Called to initialize the Plugin

func (*Memcache) InitDefaults

func (mc *Memcache) InitDefaults()

func (*Memcache) InitWithConfig

func (mc *Memcache) InitWithConfig(
	config config.Memcache,
	testMode bool,
	results publish.Transactions,
) error

func (*Memcache) Parse

func (mc *Memcache) Parse(
	pkt *protos.Packet,
	tcptuple *common.TcpTuple,
	dir uint8,
	private protos.ProtocolData,
) protos.ProtocolData

Parse is called from TCP layer when payload data is available for parsing.

func (*Memcache) ParseUdp

func (mc *Memcache) ParseUdp(pkt *protos.Packet)

func (*Memcache) ReceivedFin

func (mc *Memcache) ReceivedFin(
	tcptuple *common.TcpTuple,
	dir uint8,
	private protos.ProtocolData,
) protos.ProtocolData

ReceivedFin is called by tcp layer when the FIN flag is seen in the TCP stream.

type MemcacheHandler

type MemcacheHandler interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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