modulepackage
0.0.0-20241018143914-45ef51a0c1be
Repository: https://github.com/couchbase/sg-bucket.git
Documentation: pkg.go.dev
# README
sg-bucket
This repo contains:
- Interfaces needed by all concrete implementations of the
sgbucket.Bucket
interface, as well as by Sync Gateway itself. - Common code used by certain sg-bucket concrete implementations (walrus, forestdb-bucket) and to a lesser extent by Sync Gateway itself.
# Functions
Validates a design document.
No description provided by the author
DecodeValueWithXattrs converts DCP Xattrs value format into a body and xattrs.
DecodeValueWithXattrs converts DCP Xattrs value format into a body and zero or more Xattrs.
DecodeXattrNames extracts only the xattr names from a DCP value.
EncodeValueWithXattrs encodes a document value and Xattrs into DCP data format.
Returns true if scope.coll is a valid data store name.
MakeMeta returns a Couchbase-compatible 'meta' object, given a document ID.
No description provided by the author
Creates a new JSRunner that will run a JavaScript function.
Creates a new JSServer that will run a JavaScript function.
No description provided by the author
No description provided by the author
Validates the names and creates new scope and collection pair.
Feeds the input channel through a number of copies of the function in parallel.
Interprets parameters from a JSON map and returns a ViewParams struct.
No description provided by the author
No description provided by the author
Returns the vbucket number for a document key, produced by hashing the key string.
# Constants
Fail with ErrKeyExists if key already has a value.
Appends to value instead of replacing it.
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
No description provided by the author
No description provided by the author
Name of the default collection.
Name of the default collection.
JSON document.
raw (binary) document.
Snappy compression.
Document has Xattrs.
Value for FeedArguments.Backfill denoting that no past events at all should be sent.
Start of prior events.
A document was deleted.
End of prior events.
A document was modified.
Value for FeedArguments.Backfill denoting that the feed should resume from where it left off previously, or start from the beginning if there's no previous checkpoint.
After write, wait until it's ready for views to index.
Token used for keyspace name replacement in query statement, e.g.
Document CAS.
crc32c hash of the document body.
No description provided by the author
NotBounded indicates no data consistency is required.
After write, wait until it's written to disk.
Value is raw []byte; don't JSON-encode it.
RequestPlus indicates that request-level data consistency is required.
Delimiter between scope & collection names.
SQLite's dialect of SQL (including JSON syntax).
SQL++ as implemented by Couchbase Server.
# Variables
ErrCasFailureShouldRetry is returned from an update callback causes the function to re-fetch the doc and try again.
ErrDeleteXattrOnDocumentInsert is returned when trying to specify xattrs to delete on a document insert, which is invalid.
ErrDeleteXattrOnTombstone is returned when trying to delete an xattr on a tombstone document.
ErrDeleteXattrOnTombstoneResurrection is returned when trying to delete an xattr on a resurrection of a tombstone document.
ErrDocumentExistsOnResurrection is returned when trying to resurrect a document that already exists in a live form.
ErrEmptyMetadata is returned when there is no Sync Gateway metadata.
Error returned from QueryableStore.CreateIndex if an index with that name exists.
This specific instance will be returned if a call times out.
ErrKeyExists is returned from Write with AddOnly flag, when key already exists in the bucket.
ErrNeedBody is returned when a function requires a non nil body.
ErrNeedXattrs is returned xattrs are not specified.
ErrNilXattrValue is returned when trying to set a named xattr to a nil value.
Error returned from QueryResultIterator.One if there are no rows.
ErrPathExists is returned by subdoc operations when the path already exists, and is expected to not exist.
ErrPathMismatch is returned by subdoc operations when the path exists but has the wrong type.
ErrPathNotFound is returned by subdoc operations when the path is not found.
ErrTimeout returned from Write with Perist or Indexable flags, if the value doesn't become persistent or indexable within the timeout period.
ErrUpsertAndDeleteSameXattr is returned when trying to upsert and delete the same xattr in the same operation.
ErrXattrInvalidLen is returned if the xattr is corrupt.
# Structs
BucketDocument is a raw representation of a document, body and xattrs as bytes, along with cas.
CasMismatchErr is returned when the input CAS does not match the document's current CAS.
Simple struct implementation of DataStoreName.
A Couchbase design document, which stores map/reduce function definitions.
No description provided by the author
DocTooBigErr is returned when trying to store a document value larger than the limit (usually 20MB.).
FeedArguments are options for starting a MutationFeed.
FeedEvent is a notification of a change in a data store.
JSMapFunction is a thread-safe wrapper around a jsMapTask, i.e.
No description provided by the author
Context for JSON collation.
Go interface to a JavaScript function (like a map/reduce/channelmap/validation function.) Each JSServer object compiles a single function into a JavaScript runtime, and lets you call that function.
Thread-safe wrapper around a JSRunner.
MacroExpansionSpec is a path, value pair where the path is a xattr path and the macro to be used to populate that path.
MissingError is returned by Bucket API when a document is missing.
MutateInOptions is a struct of options for mutate in operations, to be used by both sync gateway and rosmar.
No description provided by the author
UpdatedDoc is returned by WriteUpdateWithXattrsFunc, to indicate the new document value and xattrs.
UpsertOptions are the options to use with the set operations.
No description provided by the author
Error describing a failure in a view's map function.
Parsed view parameters.
Result of a view query.
A single result row from a view query.
The name and value of an extended attribute (xattr).
XattrMissingError is returned by Bucket API when an Xattr is missing.
# Interfaces
BucketStore is a basic interface that describes a bucket - with one or many underlying DataStore.
BucketStoreFeatureIsSupported allows a BucketStore to be tested for support for various features.
DataStore is a basic key-value store with extended attributes and subdoc operations.
DataStoreName provides the methods that can give you each part of a data store.
DeletableStore is a data store that supports deletion of the underlying persistent storage.
DynamicDataStoreBucket is an interface that describes a bucket that can change its set of DataStores.
FlushableStore is a data store that supports flush.
Abstract interface for a callable interpreted function.
A KVStore implements the basic key-value CRUD operations.
MutationFeed shows events from the bucket can be read from the channel returned by Events().
MutationFeedStore is a DataStore that supports a DCP or TAP streaming mutation feed.
QueryableStore can run queries in some query language(s).
Common query iterator interface, implemented by sgbucket.ViewResult, gocb.ViewResults, and gocb.QueryResults.
SubdocStore is an extension of KVStore that allows individual properties in a document to be accessed.
A ViewStore is a data store with a map-reduce query interface compatible with CouchDB.
XattrStore is a data store that supports extended attributes, i.e.
# Type aliases
BucketStoreFeature can be tested for with BucketStoreFeatureIsSupported.IsSupported.
Specifies what level of data consistency is required in a query.
No description provided by the author
FeedDataType represents the type of data in a FeedEvent.
FeedEventCallbackFunc performs mutation processing.
FeedOpCode represents operation type (found in FeedEvent).
Alternate type to wrap a Go string in to mark that Call() should interpret it as JSON.
Factory function that creates JSServerTasks.
MacroExpansionType defines the macro expansion types used by Sync Gateway and supported by CBS and rosmar.
No description provided by the author
No description provided by the author
Identifies query languages understood by QueryableStore objects.
UpdateFunc is a callback passed to KVStore.Update.
No description provided by the author
No description provided by the author
No description provided by the author
WriteOptions are option flags for the Write method.
WriteUpdateWithXattrsFunc is used by XattrStore.WriteUpdateWithXattrs, used to transform the doc in preparation for update.