Categorygithub.com/couchbase/gocbcore
modulepackage
4.0.0+incompatible
Repository: https://github.com/couchbase/gocbcore.git
Documentation: pkg.go.dev

# README

Couchbase Go Core

This package provides the underlying Couchbase IO for the gocb project. If you are looking for the Couchbase Go SDK, you are probably looking for gocb.

License

Copyright 2016 Couchbase Inc.

Licensed under the Apache License, Version 2.0.

See LICENSE for further details.

# Functions

AcquireTimer acquires a time from a global pool of timers maintained by the library.
CreateAgent creates an agent for performing normal operations.
CreateDcpAgent creates an agent for performing DCP operations.
DecodeCommonFlags decodes a flags value into a data type and compression type using the common flags specification.
DefaultStdioLogger gets the default standard I/O logger.
DefaultStdOutLogger gets the default logger.
EncodeCommonFlags encodes a data type and compression type into a flags value using the common flags specification.
ReleaseTimer returns a timer to the global pool of timers maintained by the library.
SaslAuthBest performs SASL authentication against an AuthClient using the best supported authentication algorithm available on both client and server.
SaslAuthPlain performs PLAIN SASL authentication against an AuthClient.
SetLogger sets a logger to be used by the library.
VerboseStdioLogger is a more verbose level of DefaultStdioLogger().

# Constants

BinaryType indicates the value is binary data.
JsonType indicates the value is JSON data.
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.
Various logging levels (or subsystems) which can categorize the message.
Various logging levels (or subsystems) which can categorize the message.
Various logging levels (or subsystems) which can categorize the message.
Various logging levels (or subsystems) which can categorize the message.
Various logging levels (or subsystems) which can categorize the message.
Various logging levels (or subsystems) which can categorize the message.
Various logging levels (or subsystems) which can categorize the message.
NoCompression indicates that no compression is being used.
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.
StringType indicates the value is string data.
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.
SubdocFlagMkDoc indicates that the document 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.
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.
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.
SubDocOpReplace indicates the operation is a sub-document `Replace` operation.
UnknownCompression indicates that the compression type is unknown.
UnknownType indicates the values type is unknown.
UseLwwConflictResolution switches to Last-Write-Wins conflict resolution for the document.

# Variables

ErrAccessError occurs when an access error occurs.
ErrAuthContinue occurs in multi-step authentication when more authentication work needs to be performed in order to complete the authentication process.
ErrAuthError occurs when the authentication information provided was not valid.
ErrAuthStale occurs when authentication credentials have become invalidated.
ErrBadDelta occurs when an invalid delta value is specified to a counter operation.
ErrBadHosts occurs when the list of hosts specified cannot be contacted.
ErrBusy occurs when the server is too busy to process your request right away.
ErrDispatchFail occurs when the request router fails to dispatch an operation.
ErrInternalError occurs when internal errors prevent the server from processing your request.
ErrInvalidArgs occurs when the server receives invalid arguments for an operation.
ErrInvalidCert occurs when a certificate that is not useable is passed to an Agent.
ErrInvalidReplica occurs when an explicit, but invalid replica index is specified.
ErrInvalidServer occurs when an explicit, but invalid server index is specified.
ErrInvalidVBucket occurs when an explicit, but invalid vbucket index is specified.
ErrKeyExists occurs when an operation is performed on a key that could not be found.
ErrKeyNotFound occurs when an operation is performed on a key that does not exist.
ErrNetwork occurs when network failures prevent an operation from succeeding.
ErrNoAuthMethod occurs when the server does not support any of the authentication methods that the client finds suitable.
ErrNoBucket occurs when no bucket was selected on a connection.
ErrNoReplicas occurs when no replicas respond in time.
ErrNoServer occurs when no server is available to service a keys vbucket.
ErrNotInitialized is sent by servers which are still initializing, and are not yet ready to accept operations on behalf of a particular bucket.
ErrNotMyVBucket occurs when an operation is dispatched to a server which is non-authoritative for a specific vbucket.
ErrNotStored occurs when the server fails to store a key.
ErrNotSupported occurs when an operation is understood by the server, but that operation is not supported on this server (occurs for a variety of reasons).
ErrOutOfMemory occurs when the server cannot service a request due to memory limitations.
ErrOverload occurs when too many operations are dispatched and all queues are full.
ErrProtocol occurs when the server responds with unexpected or unparseable data.
ErrRangeError occurs when the range specified to the server is not valid.
ErrRollback occurs when a DCP stream fails to open due to a rollback having previously occurred since the last time the stream was opened.
ErrShutdown occurs when operations are performed on a previously closed Agent.
ErrStreamClosed occurs when a DCP stream is closed gracefully.
ErrStreamDisconnected occurs when a DCP stream is disconnected.
ErrStreamStateChanged occurs when a DCP stream is interrupted by failover.
ErrStreamTooSlow occurs when a DCP stream is cancelled due to the application not keeping up with the rate of flow of DCP events sent by the server.
ErrSubDocBadCombo occurs when a multi-operation sub-document operation is performed and operations within the package of ops conflict with each other.
ErrSubDocBadDelta occurs when a sub-document counter operation is performed and the specified delta is not valid.
ErrSubDocBadMulti occurs when a multi-operation sub-document operation is performed and operations within the package of ops conflict with each other.
ErrSubDocBadRange occurs when a sub-document operation is performed with a bad range.
ErrSubDocCantInsert occurs when a sub-document operation could not insert.
ErrSubDocDocTooDeep occurs when an operation would cause a document to be nested beyond the depth limits allowed by the sub-document specification.
ErrSubDocNotJson occurs when a sub-document operation is performed on a document which is not JSON.
ErrSubDocPathExists occurs when a sub-document operation expects a path not to exists, but the path was found in the document.
ErrSubDocPathInvalid occurs when a sub-document path could not be parsed.
ErrSubDocPathMismatch occurs when a sub-document operation specifies a path which does not match the document structure (field access on an array).
ErrSubDocPathNotFound occurs when a sub-document operation targets a path which does not exist in the specifie document.
ErrSubDocPathTooBig occurs when a sub-document path is too big.
ErrSubDocValueTooDeep occurs when a sub-document operation specifies a value which is deeper than the depth limits of the sub-document specification.
ErrTimeout occurs when an operation does not receive a response in a timely manner.
ErrTmpFail occurs when a temporary failure is preventing the server from processing your request.
ErrTooBig 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).
ErrUnknownCommand occurs when an unknown operation is sent to a server.

# Structs

Agent represents the base client handling connections to a Couchbase Server.
AgentConfig specifies the configuration options for creation of an Agent.
FailoverEntry represents a single entry in the server fail-over log.
MultiError encapsulates multiple errors that may be returned by one method.
MutationToken represents a particular mutation within the cluster.
SingleServerStats represents the stats returned from a single server.
SubDocMutateError encapsulates errors that occur during sub-document mutations.
SubDocOp defines a per-operation structure to be passed to MutateIn or LookupIn for performing many sub-document operations.
SubDocResult encapsulates the results from a single subdocument operation.

# Interfaces

AuthClient exposes an interface for performing authentication on a connected Couchbase K/V client.
Logger defines a logging interface.
PendingOp represents an outstanding operation within the client.
StreamObserver provides an interface to receive events from a running DCP stream.

# Type aliases

AuthFunc is invoked by the agent to authenticate a client.
Cas represents a unique revision of a document.
CloseStreamCallback is invoked with the results of `CloseStream` operations.
CompressionType indicates the type of compression for a value.
CounterCallback is invoked with the results of `Counter` operations.
CounterInCallback is invoked with the results of `CounterIn` operations.
DataType represents the type of data for a value.
ExistsInCallback is invoked with the results of `ExistsIn` operations.
GetCallback is invoked with the results of `Get` operations.
GetFailoverLogCallback is invoked with the results of `GetFailoverLog` operations.
GetInCallback is invoked with the results of `GetIn` operations.
GetRandomCallback is invoked with the results of `GetRandom` operations.
GetVBucketSeqnosCallback is invoked with the results of `GetVBucketSeqnos` operations.
KeyState represents the various storage states of a key on the server.
LogLevel specifies the severity of a log message.
LookupInCallback is invoked with the results of `LookupIn` operations.
MutateInCallback is invoked with the results of `MutateIn` operations.
ObserveCallback is invoked with the results of `Observe` operations.
ObserveSeqNoCallback is invoked with the results of `ObserveSeqNo` operations.
OpenStreamCallback is invoked with the results of `OpenStream` operations.
RemoveCallback is invoked with the results of `Remove` operations.
RemoveInCallback is invoked with the results of `RemoveIn` operations.
SeqNo is a sequential mutation number indicating the order and precise position of a write that has occurred.
ServerStatsCallback is invoked with the results of `Stats` operations.
SetMetaOption represents possible option values for a SetMeta operation.
SnapshotState represents the state of a particular cluster snapshot.
StoreCallback is invoked with the results of any basic storage operations.
StoreInCallback is invoked with the results of any sub-document storage operations.
SubdocFlag specifies flags for a sub-document operation.
SubDocOpType specifies the type of a sub-document operation.
TouchCallback is invoked with the results of `Touch` operations.
UnlockCallback is invoked with the results of `Unlock` operations.
VbUuid represents a unique identifier for a particular vbucket history.