# README
This memd library should be moved into gocbcore!
# Functions
AcquirePacket - Retrieve a packet from the internal pool.
AppendULEB128_32 appends a 32-bit number encoded as ULEB128 to a byte slice.
DecodeSrvDura16 takes an encoded operation duration from the server and converts it to a standard Go time duration.
DecodeULEB128_32 decodes a ULEB128 encoded number into a uint32.
EncodeSrvDura16 takes a standard go time duration and encodes it into the appropriate format for the server.
IsCommandCollectionEncoded returns whether a particular command code should have its key collection encoded when collections support is enabled for a particular connection.
NewConn creates a new connection object which can be used to perform reading and writing of packets.
ReleasePacket - Return a packet to the internal pool.
# Constants
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
CmdMagicReq indicates that the packet is a request.
CmdMagicRes indicates that the packet is a response.
CmdMagicServerReq indicates that the packet is a rquest originating from the server.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
These constants provide predefined values for all the operations which are supported by this library.
DatatypeFlagCompressed indicates the value payload is compressed.
DatatypeFlagJSON indicates the server believes the value payload to be JSON.
DatatypeFlagXattrs indicates the inclusion of xattr data in the value payload.
DcpOpenFlagIncludeDeleteTimes indicates the client wishes to receive delete times.
DcpOpenFlagIncludeXattrs indicates the client wishes to receive extended attributes.
DcpOpenFlagNotifier indicates this connection wants the other end to be a notifier.
DcpOpenFlagNoValue indicates the client does not wish to receive mutation values.
DcpOpenFlagPiTR indicates the client wishes to receive PITR snapshots.
DcpOpenFlagProducer indicates this connection wants the other end to be a producer.
DcpStreamAddFlagActiveOnly indicates this stream should only connect to an active vbucket.
DcpStreamAddFlagDiskOnly indicates that stream should only send items if they are on disk.
DcpStreamAddFlagLatest indicates this stream wants to get data up to the latest seqno.
DcpStreamAddFlagStrictVBUUID indicates the vbuuid must match unless the start seqno is 0 and the vbuuid is also 0.
DurabilityLevelMajority specifies that a change must be replicated to (held in memory) a majority of the nodes for the bucket.
DurabilityLevelMajorityAndPersistOnMaster specifies that a change must be replicated to (held in memory) a majority of the nodes for the bucket and additionally persisted to disk on the active node.
DurabilityLevelPersistToMajority specifies that a change must be persisted to (written to disk) a majority for the bucket.
FeatureAltRequests indicates support for requests with flexible frame extras.
FeatureClustermapChangeNotificationBrief indicates support for brief cluster map change notifications.
FeatureClusterMapKnownVersion indicates support for indicating the known version when fetching cluster maps.
FeatureClusterMapNotif indicates support for cluster-map update notifications.
FeatureCollections indicates support for collections.
FeatureCreateAsDeleted indicates support for the create as deleted feature.
FeatureDatatype indicates support for Datatype fields.
FeatureDedupeNotMyVbucketClustermap indicates support for deduplicated cluster maps on a not my vbucket response.
FeatureDuplex indicates support for duplex communications.
FeatureDurations indicates support for server durations.
FeatureJSON indicates support for JSON datatype data.
FeatureOpenTracing indicates support for OpenTracing.
FeaturePITR indicates support for PITR snapshots.
FeaturePreserveExpiry indicates support for preserve TTL.
FeatureReplaceBodyWithXattr indicates support for the replace body with xattr feature.
No description provided by the author
FeatureSelectBucket indicates support for the SelectBucket operation.
FeatureSeqNo indicates support for mutation tokens.
FeatureSnappy indicates support for snappy compressed documents.
FeatureSnappyEverywhere indicates support for snappy compressed configs as well as documents.
FeatureSubdocReplicaRead indicates support for subdoc replica reads.
FeatureSyncReplication indicates support for requests synchronous durability requirements.
FeatureTCPDelay indicates support for TCP delay.
FeatureTCPNoDelay indicates support for TCP no-delay.
FeatureTLS indicates support for TLS.
FeatureUnorderedExec indicates support for unordered execution of operations.
FeatureXattr indicates support for document xattrs.
FeatureXerror indicates support for extended errors.
ForceMetaOp disables conflict resolution for the document and allows the operation to be applied to an active, pending, or replica vbucket.
IsExpiration indicates that the message is for an expired document.
KeyStateDeleted indicates that the key has been written to disk as deleted.
KeyStateNotFound indicates that the key is not found in memory or on disk.
KeyStateNotPersisted indicates the key is in memory, but not yet written to disk.
KeyStatePersisted indicates that the key has been written to disk.
RegenerateCas causes the server to invalidate the current CAS value for a document, and to generate a new one.
SkipConflictResolution disables conflict resolution for the document.
StatusAccessError occurs when an access error occurs.
StatusAuthContinue occurs in multi-step authentication when more authentication work needs to be performed in order to complete the authentication process.
StatusAuthError occurs when the authentication information provided was not valid.
StatusAuthStale occurs when authentication credentials have become invalidated.
StatusBadDelta occurs when an invalid delta value is specified to a counter operation.
StatusBusy occurs when the server is too busy to process your request right away.
StatusCollectionUnknown occurs when a Collection cannot be found.
StatusConfigOnly occurs when an operation fails on a node because the bucket is in config-only mode.
StatusDCPStreamIDInvalid occurs when a dcp stream ID is invalid.
StatusDurabilityImpossible occurs when a request is performed with impossible durability level requirements.
StatusDurabilityInvalidLevel occurs when an invalid durability level was requested.
StatusInternalError occurs when internal errors prevent the server from processing your request.
StatusInvalidArgs occurs when the server receives invalid arguments for an operation.
StatusKeyExists occurs when an operation is performed on a key that could not be found.
StatusKeyNotFound occurs when an operation is performed on a key that does not exist.
StatusLocked occurs when an operation fails due to the document being locked.
StatusNoBucket occurs when no bucket was selected on a connection.
StatusNotInitialized is sent by servers which are still initializing, and are not yet ready to accept operations on behalf of a particular bucket.
StatusNotLocked occurs when an unlock operation occurs against a document that is not locked.
StatusNotMyVBucket occurs when an operation is dispatched to a server which is non-authoritative for a specific vbucket.
StatusNotStored occurs when the server fails to store a key.
StatusNotSupported occurs when an operation is understood by the server, but that operation is not supported on this server (occurs for a variety of reasons).
StatusOutOfMemory occurs when the server cannot service a request due to memory limitations.
StatusRangeError occurs when the range specified to the server is not valid.
StatusRangeScanCancelled occurs during a range scan to indicate that the range scan was cancelled.
StatusRangeScanComplete occurs during a range scan to indicate that a range scan has completed.
StatusRangeScanMore occurs during a range scan to indicate that a range scan has more results.
StatusRangeScanVbUUIDNotEqual occurs during a range scan to indicate that a vb-uuid mismatch has occurred.
StatusRateLimitedMaxCommands occurs when the server rate limits due to the application reaching the maximum number of allowed operations.
StatusRateLimitedMaxConnections occurs when the server rate limits due to the application reaching the maximum number of allowed connections.
StatusRateLimitedNetworkEgress occurs when the server rate limits due to network egress.
StatusRateLimitedNetworkIngress occurs when the server rate limits due to network ingress.
StatusRateLimitedScopeSizeLimitExceeded occurs when the server rate limits due to the application reaching the maximum data size allowed for the scope.
StatusRollback occurs when a DCP stream fails to open due to a rollback having previously occurred since the last time the stream was opened.
StatusScopeUnknown occurs when a Scope cannot be found.
StatusSubDocBadCombo occurs when a multi-operation sub-document operation is performed and operations within the package of ops conflict with each other.
StatusSubDocBadDelta occurs when a sub-document counter operation is performed and the specified delta is not valid.
StatusSubDocBadMulti occurs when a multi-operation sub-document operation is performed and operations within the package of ops conflict with each other.
StatusSubDocBadRange occurs when a sub-document operation is performed with a bad range.
StatusSubDocCanOnlyReviveDeletedDocuments occurs when revive document is used on a document that is not deleted.
StatusSubDocCantInsert occurs when a sub-document operation could not insert.
StatusSubDocDocTooDeep occurs when an operation would cause a document to be nested beyond the depth limits allowed by the sub-document specification.
StatusSubDocMultiPathFailureDeleted occurs when a Multi Path Failure occurs on a soft-deleted document.
StatusSubDocNotJSON occurs when a sub-document operation is performed on a document which is not JSON.
StatusSubDocPathExists occurs when a sub-document operation expects a path not to exists, but the path was found in the document.
StatusSubDocPathInvalid occurs when a sub-document path could not be parsed.
StatusSubDocPathMismatch occurs when a sub-document operation specifies a path which does not match the document structure (field access on an array).
StatusSubDocPathNotFound occurs when a sub-document operation targets a path which does not exist in the specifie document.
StatusSubDocPathTooBig occurs when a sub-document path is too big.
StatusSubDocSuccessDeleted occurs when a multi-operation sub-document operation is performed on a soft-deleted document.
StatusSubDocValueTooDeep occurs when a sub-document operation specifies a value which is deeper than the depth limits of the sub-document specification.
StatusSubDocXattrCannotModifyVAttr occurs when a mutation is attempted upon a virtual attribute (which are immutable by definition).
StatusSubDocXattrInvalidFlagCombo occurs when an invalid set of extended-attribute flags is passed to a sub-document operation.
StatusSubDocXattrInvalidKeyCombo occurs when an invalid set of key operations are specified for a extended-attribute sub-document operation.
StatusSubDocXattrUnknownMacro occurs when an invalid macro value is specified.
StatusSubDocXattrUnknownVAttr occurs when an invalid virtual attribute is specified.
StatusSuccess indicates the operation completed successfully.
StatusSyncWriteAmbiguous occurs when an SyncWrite does not complete in the specified time and the result is ambiguous.
StatusSyncWriteInProgress occurs when an attempt is made to write to a key that has a SyncWrite pending.
StatusSyncWriteReCommitInProgress occurs when an SyncWrite is being recommitted.
StatusTmpFail occurs when a temporary failure is preventing the server from processing your request.
StatusTooBig occurs when an operation attempts to store more data in a single document than the server is capable of storing (by default, this is a 20MB limit).
StatusUnknownCommand occurs when an unknown operation is sent to a server.
StreamEndBackfillFailed represents that the stream was closed due to backfill failing.
StreamEndClosed represents that the stream was forcefully closed.
StreamEndDisconnected represents that the stream was closed due to disconnection.
StreamEndFilterEmpty represents that the stream was closed due to the filter being empty.
StreamEndOK represents that the stream ended successfully.
StreamEndStateChanged represents that the stream was closed due to a state change.
StreamEndTooSlow represents that the stream was closed due to the stream being too slow.
StreamEventCollectionChanged is the StreamEventCode for a collection changed event.
StreamEventCollectionCreate is the StreamEventCode for a collection create event.
StreamEventCollectionDelete is the StreamEventCode for a collection delete event.
StreamEventCollectionFlush is the StreamEventCode for a collection flush event.
StreamEventScopeCreate is the StreamEventCode for a scope create event.
StreamEventScopeDelete is the StreamEventCode for a scope delete event.
SubdocDocFlagAccessDeleted indicates that you wish to receive soft-deleted documents.
SubdocDocFlagAddDoc indices that this operation should be an add rather than set.
SubdocDocFlagCreateAsDeleted indicates that the document should be created as deleted.
SubdocDocFlagMkDoc indicates that the document should be created if it does not already exist.
SubdocDocFlagNone indicates no special treatment for this operation.
SubdocDocFlagReplicaRead indicates that the document should be read from a replica.
SubdocDocFlagReviveDocument indicates that the document should be revived from a tombstone.
SubdocFlagExpandMacros indicates that the value portion of any sub-document mutations should be expanded if they contain macros such as ${Mutation.CAS}.
SubdocFlagMkDirP indicates that the path should be created if it does not already exist.
SubdocFlagNone indicates no special treatment for this operation.
SubdocFlagXattrPath indicates that the path refers to an Xattr rather than the document body.
SubDocOpAddDoc represents a full document add, for use with extended attribute ops.
SubDocOpArrayAddUnique indicates the operation is a sub-document `ArrayAddUnique` operation.
SubDocOpArrayInsert indicates the operation is a sub-document `ArrayInsert` operation.
SubDocOpArrayPushFirst indicates the operation is a sub-document `ArrayPushFirst` operation.
SubDocOpArrayPushLast indicates the operation is a sub-document `ArrayPushLast` operation.
SubDocOpCounter indicates the operation is a sub-document `Counter` operation.
SubDocOpDelete indicates the operation is a sub-document `Remove` operation.
SubDocOpDeleteDoc represents a full document delete, for use with extended attribute ops.
SubDocOpDictAdd indicates the operation is a sub-document `Add` operation.
SubDocOpDictSet indicates the operation is a sub-document `Set` operation.
SubDocOpExists indicates the operation is a sub-document `Exists` operation.
SubDocOpGet indicates the operation is a sub-document `Get` operation.
SubDocOpGetCount indicates the operation is a sub-document `GetCount` operation.
SubDocOpGetDoc represents a full document retrieval, for use with extended attribute ops.
SubDocOpReplace indicates the operation is a sub-document `Replace` operation.
SubDocOpReplaceBodyWithXattr represents a replace body with xattr op.
SubDocOpSetDoc represents a full document set, for use with extended attribute ops.
UseLwwConflictResolution switches to Last-Write-Wins conflict resolution for the document.
VbucketStateActive indicates the vbucket is active on this server.
VbucketStateDead indicates the vbucket is no longer valid on this server.
VbucketStatePending indicates the vbucket is preparing to become active on this server.
VbucketStateReplica indicates the vbucket is a replica on this server.
# Structs
BarrierFrame is used to signal to the server that this command should be barriered and must not be executed concurrently with other commands.
Conn represents a memcached protocol connection.
DurabilityLevelFrame allows you to specify a durability level for an operation through the frame extras.
DurabilityTimeoutFrame allows you to specify a specific timeout for durability operations to timeout.
OpenTracingFrame allows open tracing context information to be included along with a command which is being performed.
Packet represents a single request or response packet being exchanged between two clients.
PreserveExpiryFrame is used to indicate that the server should preserve the expiry time for existing document.
ReadUnitsFrame allows the server to return information about the number of read units used by a command.
ServerDurationFrame allows the server to return information about the period of time an operation took to complete.
StreamIDFrame provides information about which stream this particular operation is related to (used for DCP streams).
UnsupportedFrame is used to include an unsupported frame type in the packet data to enable further processing if needed.
UserImpersonationFrame is used to indicate a user to impersonate.
WriteUnitsFrame allows the server to return information about the number of write units used by a command.
# Type aliases
CmdCode represents the specific command the packet is performing.
CmdMagic represents the magic number that begins the header of every packet and informs the rest of the header format.
DatatypeFlag specifies data flags for the value of a document.
DcpOpenFlag specifies flags for DCP connections configured when the stream is opened.
DcpStreamAddFlag specifies flags for DCP streams configured when the stream is opened.
DurabilityLevel specifies the level to use for enhanced durability requirements.
HelloFeature represents a feature code included in a memcached HELLO operation.
KeyState represents the various storage states of a key on the server.
SetMetaOption represents possible option values for a SetMeta operation.
StatusCode represents a memcached response status.
StreamEndStatus represents the reason for a DCP stream ending.
StreamEventCode is the code for a DCP Stream event.
SubdocDocFlag specifies document-level flags for a sub-document operation.
SubdocFlag specifies flags for a sub-document operation.
SubDocOpType specifies the type of a sub-document operation.
VbucketState represents the state of a particular vbucket on a particular server.