Categorygithub.com/couchbase/gomemcached
modulepackage
0.3.2
Repository: https://github.com/couchbase/gomemcached.git
Documentation: pkg.go.dev

# README

gomemcached

This is a memcached binary protocol toolkit in go.

It provides client and server functionality as well as a little sample server showing how I might make a server if I valued purity over performance.

Server Design

overview

The basic design can be seen in gocache. A storage server is run as a goroutine that receives a MCRequest on a channel, and then issues an MCResponse to a channel contained within the request.

Each connection is a separate goroutine, of course, and is responsible for all IO for that connection until the connection drops or the dataServer decides it's stupid and sends a fatal response back over the channel.

There is currently no work at all in making the thing perform (there are specific areas I know need work). This is just my attempt to learn the language somewhat.

# Packages

go implementation of upr client.
Package mcdebug provides memcached client op statistics via expvar.
No description provided by the author
No description provided by the author
Package memcached provides useful functions for building your own memcached server.

# Functions

IsFatal is false if this error isn't believed to be fatal to a connection.
IsNotFound is true if this error represents a "not found" response.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The following is used to theoretically support frameInfo ObjID extensions for completeness, but they are not very efficient though.
TapParseBool is a function to parse a single tap boolean.
TapParseUint16 is a function to parse a single tap uint16.
TapParseUint64 is a function to parse a single tap uint64.
TapParseVBList parses a list of vBucket numbers as []uint16.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Tap connect option flags.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Range scans.
Matches with protocol/status.h as source of truth.
Tap connect option flags.
Get collection id.
No description provided by the author
No description provided by the author
Matches with protocol/status.h as source of truth.
Range scans.
Range scans.
No description provided by the author
No description provided by the author
No description provided by the author
Marks the begin and end of out-of-sequence-number stream.
Sent when the vb seqno has advanced due to an unsubscribed event.
A system event has occurred.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Matches with protocol/status.h as source of truth.
Tap connect option flags.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Not used (0x0).
(0x01).
(0x02).
(0x03).
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Used for Couchbase Server 5.0+.
Used for Couchbase Server 7.5+.
Unused zero value.
No description provided by the author
Tap connect option flags.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
0.
2.
1.
4.
3.
5.
No description provided by the author
No description provided by the author
Get current high sequence numbers from all vbuckets located on the server.
Get entire collections manifest.
No description provided by the author
Get meta.
No description provided by the author
Get from replica.
No description provided by the author
No description provided by the author
No description provided by the author
Number of bytes in a binary protocol header.
No description provided by the author
No description provided by the author
No description provided by the author
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Tap connect option flags.
Matches with protocol/status.h as source of truth.
No description provided by the author
Matches with protocol/status.h as source of truth.
No description provided by the author
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
No description provided by the author
Sequence Number based Observe.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
No description provided by the author
No description provided by the author
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Tap connect option flags.
No description provided by the author
No description provided by the author
No description provided by the author
Tap connect option flags.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Matches with protocol/status.h as source of truth.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Matches with protocol/status.h as source of truth.
Select bucket.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SubdocMultiPathFailure.
No description provided by the author
Delete a path.
No description provided by the author
allow access to XATTRs for deleted document.
Add doc only if it does not exist.
Used with mkdoc/add.
Expand macro value inside XATTR.
create path.
Create if it does not exist.
doc level flags for subdoc commands.
path level flags for subdoc commands.
No description provided by the author
if set, the path refers to an XATTR.
Get subdoc.
Matches with protocol/status.h as source of truth.
Multi lookup.
Multi mutation.
Matches with protocol/status.h as source of truth.
SUBDOC.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Tap connect option flags.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Tap connect option flags.
Tap item flags.
Notifies end of checkpoint.
Notifies start of new checkpoint.
Client-sent request to initiate Tap feed.
Notification of a DELETE on the server.
Tap item flags.
Replicates a flush_all command.
Notification of a SET/ADD/REPLACE/etc.
Tap item flags.
Opaque control data from the engine.
Tap opaque event subtypes.
Tap opaque event subtypes.
Tap opaque event subtypes.
Tap opaque event subtypes.
Tap opaque event subtypes.
Sets state of vbucket in receiver (used in takeover).
Matches with protocol/status.h as source of truth.
for log redaction.
for log redaction.
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.
Not a Memcached status.
Sent by ebucketMigrator to UPR Consumer.
UPR Buffer Acknowledgement.
Sent by eBucketMigrator to UPR Consumer.
Set flow control params.
Key deletion.
Key expiration.
Request failover logs.
Delete all the data for a vbucket.
Key mutation.
UPR NOOP.
Open a UPR connection with a name.
Start of a new snapshot.
Sent by producer when it has no more messages to stream.
Stream request from consumer to producer.
No description provided by the author
Matches with protocol/status.h as source of truth.
Matches with protocol/status.h as source of truth.

# Variables

command codes that are counted toward DCP control buffer when DCP clients receive DCP messages with these command codes, they need to provide acknowledgement.
Mapping of CommandCode -> name of command (not exhaustive).
the include deletion time bit in dcp flags.
the include XATTRS bit in dcp flags.
the producer/consumer bit in dcp flags.
No description provided by the author
No description provided by the author
The maximum reasonable body length to expect.
No description provided by the author
StatusNames human readable names for memcached response.
Datatype to Include XATTRS in SUBDOC GET.
TapConnectFlagNames for TapConnectFlag.
TapFlagParsers parser functions for TAP fields.

# Structs

No description provided by the author
MCItem is an internal representation of an item.
MCRequest is memcached Request.
MCResponse is memcached response.
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

CommandCode for memcached packets.
No description provided by the author
No description provided by the author
No description provided by the author
Status field for memcached response.
No description provided by the author
TapItemParser is a function to parse a single tap extra.