gocb: github.com/couchbaselabs/gocb Index | Files

package gocb

import "github.com/couchbaselabs/gocb"

Index

Package Files

analyticsquery_options.go auth.go bucket.go bucket_collectionsmgr.go bucket_ping.go bucket_viewindexes.go bucket_viewquery.go circuitbreaker.go client.go cluster.go cluster_analyticsindexes.go cluster_analyticsquery.go cluster_bucketmgr.go cluster_diag.go cluster_query.go cluster_queryindexes.go cluster_searchindexes.go cluster_searchquery.go cluster_usermgr.go collection.go collection_binary_crud.go collection_bulk.go collection_crud.go collection_ds.go collection_dura.go collection_subdoc.go constants.go error.go jsontime.go logging.go queryoptions.go results.go retry.go scope.go searchquery.go searchquery_facet.go searchquery_options.go searchquery_sorting.go stateblock.go thresholdlogtracer.go token.go tracing.go transcoding.go version.go viewquery_options.go

Constants

const (
    // AnalyticsScanConsistencyNotBounded indicates no data consistency is required.
    AnalyticsScanConsistencyNotBounded = AnalyticsScanConsistency(1)
    // AnalyticsScanConsistencyRequestPlus indicates that request-level data consistency is required.
    AnalyticsScanConsistencyRequestPlus = AnalyticsScanConsistency(2)
)
const (
    // ProductionDesignDocumentNamespace means that a design document resides in the production namespace.
    ProductionDesignDocumentNamespace = true

    // DevelopmentDesignDocumentNamespace means that a design document resides in the development namespace.
    DevelopmentDesignDocumentNamespace = false
)
const (
    // CouchbaseBucketType indicates a Couchbase bucket type.
    CouchbaseBucketType = BucketType("membase")

    // MemcachedBucketType indicates a Memcached bucket type.
    MemcachedBucketType = BucketType("memcached")

    // EphemeralBucketType indicates an Ephemeral bucket type.
    EphemeralBucketType = BucketType("ephemeral")
)
const (
    // ConflictResolutionTypeTimestamp specifies to use timestamp conflict resolution on the bucket.
    ConflictResolutionTypeTimestamp = ConflictResolutionType("lww")

    // ConflictResolutionTypeSequenceNumber specifies to use sequence number conflict resolution on the bucket.
    ConflictResolutionTypeSequenceNumber = ConflictResolutionType("seqno")
)
const (
    // EvictionPolicyTypeFull specifies to use full eviction for a bucket.
    EvictionPolicyTypeFull = EvictionPolicyType("fullEviction")

    // EvictionPolicyTypeValueOnly specifies to use value only eviction for a bucket.
    EvictionPolicyTypeValueOnly = EvictionPolicyType("valueOnly")
)
const (
    // CompressionModeOff specifies to use no compression for a bucket.
    CompressionModeOff = CompressionMode("off")

    // CompressionModePassive specifies to use passive compression for a bucket.
    CompressionModePassive = CompressionMode("passive")

    // CompressionModeActive specifies to use active compression for a bucket.
    CompressionModeActive = CompressionMode("active")
)
const (
    // DiagStateOk indicates that the connection state is ok.
    DiagStateOk = DiagConnState(0)

    // DiagStateDisconnected indicates that the connection is disconnected.
    DiagStateDisconnected = DiagConnState(1)
)
const (
    // StoreSemanticsReplace signifies to Replace the document, and fail if it does not exist.
    // This is the default action
    StoreSemanticsReplace = StoreSemantics(0)

    // StoreSemanticsUpsert signifies to replace the document or create it if it doesn't exist.
    StoreSemanticsUpsert = StoreSemantics(1)

    // StoreSemanticsInsert signifies to create the document, and fail if it exists.
    StoreSemanticsInsert = StoreSemantics(2)
)
const (
    // IndexTypeN1ql indicates that GSI was used to build the index.
    IndexTypeN1ql = IndexType("gsi")

    // IndexTypeView indicates that views were used to build the index.
    IndexTypeView = IndexType("views")
)
const (
    // KeyValueService represents a memcached service.
    KeyValueService = ServiceType(gocbcore.MemdService)

    // MgmtService represents a management service (typically ns_server).
    MgmtService = ServiceType(gocbcore.MgmtService)

    // CapiService represents a CouchAPI service (typically for views).
    CapiService = ServiceType(gocbcore.CapiService)

    // QueryService represents a N1QL service (typically for query).
    QueryService = ServiceType(gocbcore.N1qlService)

    // SearchService represents a full-text-search service.
    SearchService = ServiceType(gocbcore.FtsService)

    // AnalyticsService represents an analytics service.
    AnalyticsService = ServiceType(gocbcore.CbasService)
)
const (
    // QueryProfileNone disables query profiling
    QueryProfileNone = QueryProfileType("off")

    // QueryProfilePhases includes phase profiling information in the query response
    QueryProfilePhases = QueryProfileType("phases")

    // QueryProfileTimings includes timing profiling information in the query response
    QueryProfileTimings = QueryProfileType("timings")
)
const (
    // SubdocFlagNone indicates no special behaviours
    SubdocFlagNone = SubdocFlag(gocbcore.SubdocFlagNone)

    // SubdocFlagCreatePath indicates you wish to recursively create the tree of paths
    // if it does not already exist within the document.
    SubdocFlagCreatePath = SubdocFlag(gocbcore.SubdocFlagMkDirP)

    // SubdocFlagXattr indicates your path refers to an extended attribute rather than the document.
    SubdocFlagXattr = SubdocFlag(gocbcore.SubdocFlagXattrPath)

    // SubdocFlagUseMacros indicates that you wish macro substitution to occur on the value
    SubdocFlagUseMacros = SubdocFlag(gocbcore.SubdocFlagExpandMacros)
)
const (
    // SubdocDocFlagNone indicates no special behaviours
    SubdocDocFlagNone = SubdocDocFlag(gocbcore.SubdocDocFlagNone)

    // SubdocDocFlagMkDoc indicates that the document should be created if it does not already exist.
    SubdocDocFlagMkDoc = SubdocDocFlag(gocbcore.SubdocDocFlagMkDoc)

    // SubdocDocFlagAddDoc indices that the document should be created only if it does not already exist.
    SubdocDocFlagAddDoc = SubdocDocFlag(gocbcore.SubdocDocFlagReplaceDoc)

    // SubdocDocFlagAccessDeleted indicates that you wish to receive soft-deleted documents.
    SubdocDocFlagAccessDeleted = SubdocDocFlag(gocbcore.SubdocDocFlagAccessDeleted)
)
const (
    // DurabilityLevelMajority specifies that a mutation must be replicated (held in memory) to a majority of nodes.
    DurabilityLevelMajority = DurabilityLevel(1)

    // DurabilityLevelMajorityAndPersistOnMaster specifies that a mutation must be replicated (held in memory) to a
    // majority of nodes and also persisted (written to disk) on the active node.
    DurabilityLevelMajorityAndPersistOnMaster = DurabilityLevel(2)

    // DurabilityLevelPersistToMajority specifies that a mutation must be persisted (written to disk) to a majority
    // of nodes.
    DurabilityLevelPersistToMajority = DurabilityLevel(3)
)
const (
    // MutationMacroCAS can be used to tell the server to use the CAS macro.
    MutationMacroCAS = MutationMacro("${Mutation.CAS}")

    // MutationMacroSeqNo can be used to tell the server to use the seqno macro.
    MutationMacroSeqNo = MutationMacro("${Mutation.seqno}")

    // MutationMacroValueCRC32c can be used to tell the server to use the value_crc32c macro.
    MutationMacroValueCRC32c = MutationMacro("${Mutation.value_crc32c}")
)
const (
    LogError        = LogLevel(gocbcore.LogError)
    LogWarn         = LogLevel(gocbcore.LogWarn)
    LogInfo         = LogLevel(gocbcore.LogInfo)
    LogDebug        = LogLevel(gocbcore.LogDebug)
    LogTrace        = LogLevel(gocbcore.LogTrace)
    LogSched        = LogLevel(gocbcore.LogSched)
    LogMaxVerbosity = LogLevel(gocbcore.LogMaxVerbosity)
)

Various logging levels (or subsystems) which can categorize the message. Currently these are ordered in decreasing severity.

const (
    // RedactNone indicates to perform no redactions
    RedactNone = LogRedactLevel(0)

    // RedactPartial indicates to redact all possible user-identifying information from logs.
    RedactPartial = LogRedactLevel(1)

    // RedactFull indicates to fully redact all possible identifying information from logs.
    RedactFull = LogRedactLevel(2)
)
const (
    // QueryScanConsistencyNotBounded indicates no data consistency is required.
    QueryScanConsistencyNotBounded = QueryScanConsistency(1)
    // QueryScanConsistencyRequestPlus indicates that request-level data consistency is required.
    QueryScanConsistencyRequestPlus = QueryScanConsistency(2)
)
const (
    // DefaultHighlightStyle specifies to use the default to highlight search result hits.
    DefaultHighlightStyle = SearchHighlightStyle("")

    // HtmlHighlightStyle specifies to use HTML tags to highlight search result hits.
    HtmlHighlightStyle = SearchHighlightStyle("html")

    // AnsiHightlightStyle specifies to use ANSI tags to highlight search result hits.
    AnsiHightlightStyle = SearchHighlightStyle("ansi")
)
const (
    // ViewScanConsistencyNotBounded indicates that no special behaviour should be used.
    ViewScanConsistencyNotBounded = ViewScanConsistency(1)
    // ViewScanConsistencyRequestPlus indicates to update the index before querying it.
    ViewScanConsistencyRequestPlus = ViewScanConsistency(2)
    // ViewScanConsistencyUpdateAfter indicates to update the index asynchronously after querying.
    ViewScanConsistencyUpdateAfter = ViewScanConsistency(3)
)
const (
    // ViewOrderingAscending indicates the query results should be sorted from lowest to highest.
    ViewOrderingAscending = ViewOrdering(1)
    // ViewOrderingDescending indicates the query results should be sorted from highest to lowest.
    ViewOrderingDescending = ViewOrdering(2)
)
const (
    // ViewErrorModeContinue indicates to continue gathering results on error.
    ViewErrorModeContinue = ViewErrorMode(1)

    // ViewErrorModeStop indicates to stop gathering results on error
    ViewErrorModeStop = ViewErrorMode(2)
)
const (
    // SearchScanConsistencyNotBounded indicates no data consistency is required.
    SearchScanConsistencyNotBounded = SearchScanConsistency(1)
)

Variables

var (
    // UnknownRetryReason indicates that the operation failed for an unknown reason.
    UnknownRetryReason = RetryReason(gocbcore.UnknownRetryReason)

    // SocketNotAvailableRetryReason indicates that the operation failed because the underlying socket was not available.
    SocketNotAvailableRetryReason = RetryReason(gocbcore.SocketNotAvailableRetryReason)

    // ServiceNotAvailableRetryReason indicates that the operation failed because the requested service was not available.
    ServiceNotAvailableRetryReason = RetryReason(gocbcore.ServiceNotAvailableRetryReason)

    // NodeNotAvailableRetryReason indicates that the operation failed because the requested node was not available.
    NodeNotAvailableRetryReason = RetryReason(gocbcore.NodeNotAvailableRetryReason)

    // KVNotMyVBucketRetryReason indicates that the operation failed because it was sent to the wrong node for the vbucket.
    KVNotMyVBucketRetryReason = RetryReason(gocbcore.KVNotMyVBucketRetryReason)

    // KVCollectionOutdatedRetryReason indicates that the operation failed because the collection ID on the request is outdated.
    KVCollectionOutdatedRetryReason = RetryReason(gocbcore.KVCollectionOutdatedRetryReason)

    // KVErrMapRetryReason indicates that the operation failed for an unsupported reason but the KV error map indicated
    // that the operation can be retried.
    KVErrMapRetryReason = RetryReason(gocbcore.KVErrMapRetryReason)

    // KVLockedRetryReason indicates that the operation failed because the document was locked.
    KVLockedRetryReason = RetryReason(gocbcore.KVLockedRetryReason)

    // KVTemporaryFailureRetryReason indicates that the operation failed because of a temporary failure.
    KVTemporaryFailureRetryReason = RetryReason(gocbcore.KVTemporaryFailureRetryReason)

    // KVSyncWriteInProgressRetryReason indicates that the operation failed because a sync write is in progress.
    KVSyncWriteInProgressRetryReason = RetryReason(gocbcore.KVSyncWriteInProgressRetryReason)

    // KVSyncWriteRecommitInProgressRetryReason indicates that the operation failed because a sync write recommit is in progress.
    KVSyncWriteRecommitInProgressRetryReason = RetryReason(gocbcore.KVSyncWriteRecommitInProgressRetryReason)

    // ServiceResponseCodeIndicatedRetryReason indicates that the operation failed and the service responded stating that
    // the request should be retried.
    ServiceResponseCodeIndicatedRetryReason = RetryReason(gocbcore.ServiceResponseCodeIndicatedRetryReason)

    // SocketCloseInFlightRetryReason indicates that the operation failed because the socket was closed whilst the operation
    // was in flight.
    SocketCloseInFlightRetryReason = RetryReason(gocbcore.SocketCloseInFlightRetryReason)
)

func ErrorCause Uses

func ErrorCause(err error) error

ErrorCause returns the underlying cause of an error.

func Identifier Uses

func Identifier() string

Identifier returns a string representation of the current SDK identifier.

func IsAnalyticsDatasetAlreadyExistsError Uses

func IsAnalyticsDatasetAlreadyExistsError(err error) bool

IsAnalyticsDatasetAlreadyExistsError verifies that an analytics dataset already exists.

func IsAnalyticsDatasetNotFoundError Uses

func IsAnalyticsDatasetNotFoundError(err error) bool

IsAnalyticsDatasetNotFoundError verifies that an analytics dataset could not be found.

func IsAnalyticsDataverseAlreadyExistsError Uses

func IsAnalyticsDataverseAlreadyExistsError(err error) bool

IsAnalyticsDataverseAlreadyExistsError verifies that an analytics dataverse already exists.

func IsAnalyticsDataverseNotFoundError Uses

func IsAnalyticsDataverseNotFoundError(err error) bool

IsAnalyticsDataverseNotFoundError verifies that an analytics dataverse could not be found.

func IsAnalyticsIndexAlreadyExistsError Uses

func IsAnalyticsIndexAlreadyExistsError(err error) bool

IsAnalyticsIndexAlreadyExistsError verifies that an analytics index already exists.

func IsAnalyticsIndexNotFoundError Uses

func IsAnalyticsIndexNotFoundError(err error) bool

IsAnalyticsIndexNotFoundError verifies that an analytics index could not be found.

func IsAnalyticsLinkNotFoundError Uses

func IsAnalyticsLinkNotFoundError(err error) bool

IsAnalyticsLinkNotFoundError verifies that an analytics link could not be found.

func IsAuthenticationError Uses

func IsAuthenticationError(err error) bool

IsAuthenticationError verifies whether or not the cause for an error is an authentication error.

func IsBucketExistsError Uses

func IsBucketExistsError(err error) bool

IsBucketExistsError occurs when a specific bucket already exists.

func IsBucketNotFoundError Uses

func IsBucketNotFoundError(err error) bool

IsBucketNotFoundError occurs when a specific bucket could not be found.

func IsCannotInsertValueError Uses

func IsCannotInsertValueError(err error) bool

IsCannotInsertValueError indicates whether the passed error occurred because the target document is not flagged or recognized as JSON.

func IsCasMismatchError Uses

func IsCasMismatchError(err error) bool

IsCasMismatchError verifies whether or not the cause for an error is a cas mismatch.

func IsCollectionExistsError Uses

func IsCollectionExistsError(err error) bool

IsCollectionExistsError occurs when a specific collection already exists.

func IsCollectionNotFoundError Uses

func IsCollectionNotFoundError(err error) bool

IsCollectionNotFoundError verifies whether or not the cause for an error is scope unknown.

func IsConfigurationError Uses

func IsConfigurationError(err error) bool

IsConfigurationError verifies whether or not the cause for an error is a configuration error.

func IsDeltaRangeError Uses

func IsDeltaRangeError(err error) bool

IsDeltaRangeError indicates whether the passed error occurred because for arithmetic subdoc operations, the operation will make the value out of valid range.

func IsDesignDocumentExistsError Uses

func IsDesignDocumentExistsError(err error) bool

IsDesignDocumentExistsError occurs when a specific design document already exists.

func IsDesignDocumentNotFoundError Uses

func IsDesignDocumentNotFoundError(err error) bool

IsDesignDocumentNotFoundError occurs when a specific design document could not be found.

func IsDesignDocumentPublishDropFailError Uses

func IsDesignDocumentPublishDropFailError(err error) bool

IsDesignDocumentPublishDropFailError occurs when dropping a design document already exists.

func IsDocumentNotJsonEerror Uses

func IsDocumentNotJsonEerror(err error) bool

IsDocumentNotJsonEerror indicates whether the passed error occurred because the existing document is not valid JSON.

func IsDocumentTooDeepError Uses

func IsDocumentTooDeepError(err error) bool

IsDocumentTooDeepError indicates whether the passed error occurred because the target document's level of JSON nesting is too deep to be processed by the subdoc service.

func IsDurabilityError Uses

func IsDurabilityError(err error) bool

IsDurabilityError verifies whether or not the cause for an error is due to a durability error.

func IsDurabilityImpossibleError Uses

func IsDurabilityImpossibleError(err error) bool

IsDurabilityImpossibleError verifies whether or not the cause for an error is because the requested durability level is impossible given the cluster topology due to insufficient replica servers.

func IsDurabilityLevelInvalidError Uses

func IsDurabilityLevelInvalidError(err error) bool

IsDurabilityLevelInvalidError verifies whether or not the cause for an error is because the requested durability level is invalid.

func IsFeatureNotFoundError Uses

func IsFeatureNotFoundError(err error) bool

IsFeatureNotFoundError verifies that an error occurred because the requested feature is not supported by the server.

func IsGroupNotFoundError Uses

func IsGroupNotFoundError(err error) bool

IsGroupNotFoundError verifies that a group could not be found.

func IsInvalidArgumentsError Uses

func IsInvalidArgumentsError(err error) bool

IsInvalidArgumentsError indicates whether the passed error occurred due to invalid arguments being passed to an operation.

func IsInvalidIndexError Uses

func IsInvalidIndexError(err error) bool

IsInvalidIndexError verifies whether or not the cause for an error is due to an invalid index being specified on a LookupInResult

func IsKeyExistsError Uses

func IsKeyExistsError(err error) bool

IsKeyExistsError indicates whether the passed error is a key-value "Key Already Exists" error.

func IsKeyLockedError Uses

func IsKeyLockedError(err error) bool

IsKeyLockedError indicates whether the passed error is a key-value operation failed due to the document being locked.

func IsKeyNotFoundError Uses

func IsKeyNotFoundError(err error) bool

IsKeyNotFoundError indicates whether the passed error is a key-value "Key Not Found" error.

func IsKeyValueError Uses

func IsKeyValueError(err error) bool

IsKeyValueError verifies whether or not the cause for an error is a KeyValueError.

func IsNoReplicasError Uses

func IsNoReplicasError(err error) bool

IsNoReplicasError verifies whether or not the cause for an error is because of an the client could not locate a replica within the cluster map or replica read. The Bucket may not be configured to have replicas, which should be checked to ensure replica reads.

func IsNoResultsError Uses

func IsNoResultsError(err error) bool

IsNoResultsError verifies whether or not the cause for an error is due no results being available to a query.

func IsNumRangeError Uses

func IsNumRangeError(err error) bool

IsNumRangeError indicates whether the passed error occurred because for arithmetic subdoc operations, the existing number is out of the valid range.

func IsPathExistsError Uses

func IsPathExistsError(err error) bool

IsPathExistsError indicates whether the passed error occurred because the last component of the path already exist despite the mutation operation expecting it not to exist (the mutation was expecting to create only the last part of the path and store the fragment there).

func IsPathInvalidError Uses

func IsPathInvalidError(err error) bool

IsPathInvalidError indicates whether the passed error occurred because the path provided is invalid. For operations requiring an array index, this is returned if the last component of that path isn't an array. Similarly for operations requiring a dictionary, if the last component isn't a dictionary but eg. an array index.

func IsPathMismatchError Uses

func IsPathMismatchError(err error) bool

IsPathMismatchError indicates whether the passed error occurred because the path component does not match the type of the element requested.

func IsPathNotFoundError Uses

func IsPathNotFoundError(err error) bool

IsPathNotFoundError indicates whether the passed error is a key-value "sub-document path does not exist" error.

func IsPathTooDeepError Uses

func IsPathTooDeepError(err error) bool

IsPathTooDeepError indicates whether the passed error occurred because the path is too large (ie. the string is too long) or too deep (more than 32 components).

func IsQueryIndexAlreadyExistsError Uses

func IsQueryIndexAlreadyExistsError(err error) bool

IsQueryIndexAlreadyExistsError verifies that an index already exists.

func IsQueryIndexNotFoundError Uses

func IsQueryIndexNotFoundError(err error) bool

IsQueryIndexNotFoundError verifies that an index could not be found.

func IsQueueOverloadError Uses

func IsQueueOverloadError(err error) bool

IsQueueOverloadError verifies that the cause for an error is that more operations were dispatched than the client is capable of writing.

func IsRetryableError Uses

func IsRetryableError(err error) bool

IsRetryableError indicates that the operation should be retried.

func IsScopeExistsError Uses

func IsScopeExistsError(err error) bool

IsScopeExistsError occurs when a specific scope already exists.

func IsScopeNotFoundError Uses

func IsScopeNotFoundError(err error) bool

IsScopeNotFoundError verifies whether or not the cause for an error is scope unknown.

func IsSearchIndexNotFoundError Uses

func IsSearchIndexNotFoundError(err error) bool

IsSearchIndexNotFoundError verifies that an index could not be found.

func IsServiceNotAvailableError Uses

func IsServiceNotAvailableError(err error) bool

IsServiceNotAvailableError indicates whether the passed error occurred due to the requested service not being available.

func IsServiceNotConfiguredError Uses

func IsServiceNotConfiguredError(err error) bool

IsServiceNotConfiguredError verifies that no nodes could be found for the specified service.

func IsSubDocInvalidArgumentsError Uses

func IsSubDocInvalidArgumentsError(err error) bool

IsSubDocInvalidArgumentsError indicates whether the passed error occurred because in a multi-specification, an invalid combination of commands were specified, including the case where too many paths were specified.

func IsSubdocPathExistsError Uses

func IsSubdocPathExistsError(err error) bool

IsSubdocPathExistsError verifies whether or not the cause for an error is due to a subdoc operation path exists

func IsSubdocPathNotFoundError Uses

func IsSubdocPathNotFoundError(err error) bool

IsSubdocPathNotFoundError verifies whether or not the cause for an error is due to a subdoc operation path not found.

func IsSyncWriteAmbiguousError Uses

func IsSyncWriteAmbiguousError(err error) bool

IsSyncWriteAmbiguousError verifies whether or not the cause for an error is because the client could not locate a replica within the cluster map or replica read. The bucket may not be configured to have replicas, which should be checked to ensure replica reads.

func IsSyncWriteInProgressError Uses

func IsSyncWriteInProgressError(err error) bool

IsSyncWriteInProgressError verifies whether or not the cause for an error is because of an attempt to mutate a document which has a SyncWrite pending. Client should retry, possibly with backoff.

func IsSyncWriteReCommitInProgressError Uses

func IsSyncWriteReCommitInProgressError(err error) bool

IsSyncWriteReCommitInProgressError verifies whether or not the cause for an error is because of an attempt to mutate a key which has a SyncWrite recommit pending. Client should retry, possibly with backoff.

func IsTemporaryFailureError Uses

func IsTemporaryFailureError(err error) bool

IsTemporaryFailureError indicates whether the passed error is a key-value "temporary failure, try again later" error.

func IsTimeoutError Uses

func IsTimeoutError(err error) bool

IsTimeoutError verifies whether or not the cause for an error is a timeout.

func IsUserNotFoundError Uses

func IsUserNotFoundError(err error) bool

IsUserNotFoundError verifies that a user could not be found.

func IsValueTooLargeError Uses

func IsValueTooLargeError(err error) bool

IsValueTooLargeError indicates whether the passed error is a key-value "document value was too large" error.

func IsXattrUnknownMacroError Uses

func IsXattrUnknownMacroError(err error) bool

IsXattrUnknownMacroError indicates whether the passed error occurred because the server has no knowledge of the requested macro.

func SetLogRedactionLevel Uses

func SetLogRedactionLevel(level LogRedactLevel)

SetLogRedactionLevel specifies the level with which logs should be redacted.

func SetLogger Uses

func SetLogger(logger Logger)

SetLogger sets a logger to be used by the library. A logger can be obtained via the DefaultStdioLogger() or VerboseStdioLogger() functions. You can also implement your own logger using the Logger interface.

func Version Uses

func Version() string

Version returns a string representation of the current SDK version.

type AllowQueryingSearchIndexOptions Uses

type AllowQueryingSearchIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

AllowQueryingSearchIndexOptions is the set of options available to the search index AllowQuerying operation.

type AnalyticsDataset Uses

type AnalyticsDataset struct {
    Name          string `json:"DatasetName"`
    DataverseName string `json:"DataverseName"`
    LinkName      string `json:"LinkName"`
    BucketName    string `json:"BucketName"`
}

AnalyticsDataset contains information about an analytics dataset,

type AnalyticsIndex Uses

type AnalyticsIndex struct {
    Name          string `json:"IndexName"`
    DatasetName   string `json:"DatasetName"`
    DataverseName string `json:"DataverseName"`
    IsPrimary     bool   `json:"IsPrimary"`
}

AnalyticsIndex contains information about an analytics index,

type AnalyticsIndexManager Uses

type AnalyticsIndexManager struct {
    // contains filtered or unexported fields
}

AnalyticsIndexManager provides methods for performing Couchbase Analytics index management. Volatile: This API is subject to change at any time.

func (am *AnalyticsIndexManager) ConnectLink(opts *ConnectAnalyticsLinkOptions) error

ConnectLink connects an analytics link.

func (*AnalyticsIndexManager) CreateDataset Uses

func (am *AnalyticsIndexManager) CreateDataset(datasetName, bucketName string, opts *CreateAnalyticsDatasetOptions) error

CreateDataset creates a new analytics dataset.

func (*AnalyticsIndexManager) CreateDataverse Uses

func (am *AnalyticsIndexManager) CreateDataverse(dataverseName string, opts *CreateAnalyticsDataverseOptions) error

CreateDataverse creates a new analytics dataset.

func (*AnalyticsIndexManager) CreateIndex Uses

func (am *AnalyticsIndexManager) CreateIndex(datasetName, indexName string, fields map[string]string, opts *CreateAnalyticsIndexOptions) error

CreateIndex creates a new analytics dataset.

func (am *AnalyticsIndexManager) DisconnectLink(opts *DisconnectAnalyticsLinkOptions) error

DisconnectLink disconnects an analytics link.

func (*AnalyticsIndexManager) DropDataset Uses

func (am *AnalyticsIndexManager) DropDataset(datasetName string, opts *DropAnalyticsDatasetOptions) error

DropDataset drops an analytics dataset.

func (*AnalyticsIndexManager) DropDataverse Uses

func (am *AnalyticsIndexManager) DropDataverse(dataverseName string, opts *DropAnalyticsDataverseOptions) error

DropDataverse drops an analytics dataset.

func (*AnalyticsIndexManager) DropIndex Uses

func (am *AnalyticsIndexManager) DropIndex(datasetName, indexName string, opts *DropAnalyticsIndexOptions) error

DropIndex drops an analytics index.

func (*AnalyticsIndexManager) GetAllDatasets Uses

func (am *AnalyticsIndexManager) GetAllDatasets(opts *GetAllAnalyticsDatasetsOptions) ([]AnalyticsDataset, error)

GetAllDatasets gets all analytics datasets.

func (*AnalyticsIndexManager) GetAllIndexes Uses

func (am *AnalyticsIndexManager) GetAllIndexes(opts *GetAllAnalyticsIndexesOptions) ([]AnalyticsIndex, error)

GetAllIndexes gets all analytics indexes.

func (*AnalyticsIndexManager) GetPendingMutations Uses

func (am *AnalyticsIndexManager) GetPendingMutations(opts *GetPendingMutationsAnalyticsOptions) (map[string]int, error)

GetPendingMutations returns the number of pending mutations for all indexes in the form of dataverse.dataset:mutations.

type AnalyticsIndexesError Uses

type AnalyticsIndexesError interface {
    error
    HTTPStatus() int
    AnalyticsIndexNotFoundError() bool
    AnalyticsIndexExistsError() bool
    AnalyticsDatasetNotFoundError() bool
    AnalyticsDatasetExistsError() bool
    AnalyticsDataverseExistsError() bool
    AnalyticsDataverseNotFoundError() bool
    AnalyticsLinkNotFoundError() bool
}

AnalyticsIndexesError occurs for errors created By Couchbase Server when performing analytics index management.

type AnalyticsMetadata Uses

type AnalyticsMetadata struct {
    // contains filtered or unexported fields
}

AnalyticsMetadata provides access to the metadata properties of an Analytics query result.

func (*AnalyticsMetadata) ClientContextID Uses

func (r *AnalyticsMetadata) ClientContextID() string

ClientContextID returns the context ID used for this query.

func (*AnalyticsMetadata) Metrics Uses

func (r *AnalyticsMetadata) Metrics() AnalyticsMetrics

Metrics returns metrics about execution of this result.

func (*AnalyticsMetadata) RequestID Uses

func (r *AnalyticsMetadata) RequestID() string

RequestID returns the request ID used for this query.

func (*AnalyticsMetadata) Signature Uses

func (r *AnalyticsMetadata) Signature() interface{}

Signature returns TODO

func (*AnalyticsMetadata) Status Uses

func (r *AnalyticsMetadata) Status() string

Status returns the status for the results.

func (*AnalyticsMetadata) Warnings Uses

func (r *AnalyticsMetadata) Warnings() []AnalyticsWarning

Warnings returns any warnings that occurred during query execution.

type AnalyticsMetrics Uses

type AnalyticsMetrics struct {
    ElapsedTime      time.Duration
    ExecutionTime    time.Duration
    ResultCount      uint
    ResultSize       uint
    MutationCount    uint
    SortCount        uint
    ErrorCount       uint
    WarningCount     uint
    ProcessedObjects uint
}

AnalyticsMetrics encapsulates various metrics gathered during a queries execution.

type AnalyticsOptions Uses

type AnalyticsOptions struct {
    // Timeout and context are used to control cancellation of the data stream. Any timeout or deadline will also be
    // propagated to the server.
    ServerSideTimeout    time.Duration
    Context              context.Context
    ClientContextID      string
    Raw                  map[string]interface{}
    Priority             bool
    PositionalParameters []interface{}
    NamedParameters      map[string]interface{}
    ReadOnly             bool
    ScanConsistency      AnalyticsScanConsistency

    // JSONSerializer is used to deserialize each row in the result. This should be a JSON deserializer as results are JSON.
    // NOTE: if not set then query will always default to DefaultJSONSerializer.
    Serializer    JSONSerializer
    RetryStrategy RetryStrategy
}

AnalyticsOptions is the set of options available to an Analytics query.

type AnalyticsQueryError Uses

type AnalyticsQueryError interface {
    error
    Code() uint32
    Message() string
    HTTPStatus() int
    Endpoint() string
    ContextID() string
}

AnalyticsQueryError occurs for errors created by Couchbase Server during Analytics query execution.

type AnalyticsResult Uses

type AnalyticsResult struct {
    // contains filtered or unexported fields
}

AnalyticsResult allows access to the results of an Analytics query.

func (*AnalyticsResult) Close Uses

func (r *AnalyticsResult) Close() error

Close marks the results as closed, returning any errors that occurred during reading the results.

func (*AnalyticsResult) Metadata Uses

func (r *AnalyticsResult) Metadata() (*AnalyticsMetadata, error)

Metadata returns metadata for this result.

func (*AnalyticsResult) Next Uses

func (r *AnalyticsResult) Next(valuePtr interface{}) bool

Next assigns the next result from the results into the value pointer, returning whether the read was successful.

func (*AnalyticsResult) NextBytes Uses

func (r *AnalyticsResult) NextBytes() []byte

NextBytes returns the next result from the results as a byte array.

func (*AnalyticsResult) One Uses

func (r *AnalyticsResult) One(valuePtr interface{}) error

One assigns the first value from the results into the value pointer. It will close the results but not before iterating through all remaining results, as such this should only be used for very small resultsets - ideally of, at most, length 1.

type AnalyticsScanConsistency Uses

type AnalyticsScanConsistency int

AnalyticsScanConsistency indicates the level of data consistency desired for an analytics query.

type AnalyticsWarning Uses

type AnalyticsWarning struct {
    Code    uint32 `json:"code"`
    Message string `json:"msg"`
}

AnalyticsWarning represents any warning generating during the execution of an Analytics query.

type AnalyzeDocumentOptions Uses

type AnalyzeDocumentOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

AnalyzeDocumentOptions is the set of options available to the search index AnalyzeDocument operation.

type AppendOp Uses

type AppendOp struct {
    ID     string
    Value  string
    Result *MutationResult
    Err    error
    // contains filtered or unexported fields
}

AppendOp represents a type of `BulkOp` used for Append operations. See BulkOp.

type AppendOptions Uses

type AppendOptions struct {
    Timeout         time.Duration
    Context         context.Context
    DurabilityLevel DurabilityLevel
    PersistTo       uint
    ReplicateTo     uint
    Cas             Cas
    RetryStrategy   RetryStrategy
}

AppendOptions are the options available to the Append operation.

type ArrayAddUniqueSpecOptions Uses

type ArrayAddUniqueSpecOptions struct {
    CreatePath bool
    IsXattr    bool
}

ArrayAddUniqueSpecOptions are the options available to subdocument ArrayAddUnique operations.

type ArrayAppendSpecOptions Uses

type ArrayAppendSpecOptions struct {
    CreatePath bool
    IsXattr    bool
    // HasMultiple adds multiple values as elements to an array.
    // When used `value` in the spec must be an array type
    // ArrayAppend("path", []int{1,2,3,4}, ArrayAppendSpecOptions{HasMultiple:true}) =>
    //   "path" [..., 1,2,3,4]
    //
    // This is a more efficient version (at both the network and server levels)
    // of doing
    // spec.ArrayAppend("path", 1, nil)
    // spec.ArrayAppend("path", 2, nil)
    // spec.ArrayAppend("path", 3, nil)
    HasMultiple bool
}

ArrayAppendSpecOptions are the options available to subdocument ArrayAppend operations.

type ArrayInsertSpecOptions Uses

type ArrayInsertSpecOptions struct {
    CreatePath bool
    IsXattr    bool
    // HasMultiple adds multiple values as elements to an array.
    // When used `value` in the spec must be an array type
    // ArrayInsert("path[1]", []int{1,2,3,4}, ArrayInsertSpecOptions{HasMultiple:true}) =>
    //   "path" [..., 1,2,3,4]
    //
    // This is a more efficient version (at both the network and server levels)
    // of doing
    // spec.ArrayInsert("path[2]", 1, nil)
    // spec.ArrayInsert("path[3]", 2, nil)
    // spec.ArrayInsert("path[4]", 3, nil)
    HasMultiple bool
}

ArrayInsertSpecOptions are the options available to subdocument ArrayInsert operations.

type ArrayPrependSpecOptions Uses

type ArrayPrependSpecOptions struct {
    CreatePath bool
    IsXattr    bool
    // HasMultiple adds multiple values as elements to an array.
    // When used `value` in the spec must be an array type
    // ArrayPrepend("path", []int{1,2,3,4}, ArrayPrependSpecOptions{HasMultiple:true}) =>
    //   "path" [1,2,3,4, ....]
    //
    // This is a more efficient version (at both the network and server levels)
    // of doing
    // spec.ArrayPrepend("path", 1, nil)
    // spec.ArrayPrepend("path", 2, nil)
    // spec.ArrayPrepend("path", 3, nil)
    HasMultiple bool
}

ArrayPrependSpecOptions are the options available to subdocument ArrayPrepend operations.

type AuthCredsRequest Uses

type AuthCredsRequest struct {
    Service  ServiceType
    Endpoint string
}

AuthCredsRequest encapsulates the data for a credential request from the new Authenticator interface. UNCOMMITTED

type AuthDomain Uses

type AuthDomain string

AuthDomain specifies the user domain of a specific user

const (
    // LocalDomain specifies users that are locally stored in Couchbase.
    LocalDomain AuthDomain = "local"

    // ExternalDomain specifies users that are externally stored
    // (in LDAP for instance).
    ExternalDomain AuthDomain = "external"
)

type AuthenticationError Uses

type AuthenticationError interface {
    AuthenticationError() bool
}

AuthenticationError represents an error caused by an authentication issue.

type Authenticator Uses

type Authenticator interface {
    Credentials(req AuthCredsRequest) ([]UserPassPair, error)
}

Authenticator provides an interface to authenticate to each service. Note that only authenticators implemented here are stable, and support for custom authenticators is considered volatile.

type BackoffCalculator Uses

type BackoffCalculator func(retryAttempts uint32) time.Duration

BackoffCalculator defines how backoff durations will be calculated by the retry API.g

type BestEffortRetryStrategy Uses

type BestEffortRetryStrategy struct {
    // contains filtered or unexported fields
}

BestEffortRetryStrategy represents a strategy that will keep retrying until it succeeds (or the caller times out the request).

func NewBestEffortRetryStrategy Uses

func NewBestEffortRetryStrategy(calculator BackoffCalculator) *BestEffortRetryStrategy

NewBestEffortRetryStrategy returns a new BestEffortRetryStrategy which will use the supplied calculator function to calculate retry durations. If calculator is nil then a controlled backoff will be used.

func (*BestEffortRetryStrategy) RetryAfter Uses

func (rs *BestEffortRetryStrategy) RetryAfter(req RetryRequest, reason RetryReason) RetryAction

RetryAfter calculates and returns a RetryAction describing how long to wait before retrying an operation.

type BinaryCollection Uses

type BinaryCollection struct {
    // contains filtered or unexported fields
}

BinaryCollection is a set of binary operations.

func (*BinaryCollection) Append Uses

func (c *BinaryCollection) Append(id string, val []byte, opts *AppendOptions) (mutOut *MutationResult, errOut error)

Append appends a byte value to a document.

func (*BinaryCollection) Decrement Uses

func (c *BinaryCollection) Decrement(id string, opts *CounterOptions) (countOut *CounterResult, errOut error)

Decrement performs an atomic subtraction for an integer document. Passing a non-negative `initial` value will cause the document to be created if it did not already exist.

func (*BinaryCollection) Increment Uses

func (c *BinaryCollection) Increment(id string, opts *CounterOptions) (countOut *CounterResult, errOut error)

Increment performs an atomic addition for an integer document. Passing a non-negative `initial` value will cause the document to be created if it did not already exist.

func (*BinaryCollection) Prepend Uses

func (c *BinaryCollection) Prepend(id string, val []byte, opts *PrependOptions) (mutOut *MutationResult, errOut error)

Prepend prepends a byte value to a document.

type BooleanFieldQuery Uses

type BooleanFieldQuery struct {
    // contains filtered or unexported fields
}

BooleanFieldQuery represents a FTS boolean field query.

func NewBooleanFieldQuery Uses

func NewBooleanFieldQuery(val bool) *BooleanFieldQuery

NewBooleanFieldQuery creates a new BooleanFieldQuery.

func (*BooleanFieldQuery) Boost Uses

func (q *BooleanFieldQuery) Boost(boost float32) *BooleanFieldQuery

Boost specifies the boost for this query.

func (*BooleanFieldQuery) Field Uses

func (q *BooleanFieldQuery) Field(field string) *BooleanFieldQuery

Field specifies the field for this query.

func (BooleanFieldQuery) MarshalJSON Uses

func (q BooleanFieldQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type BooleanQuery Uses

type BooleanQuery struct {
    // contains filtered or unexported fields
}

BooleanQuery represents a FTS boolean query.

func NewBooleanQuery Uses

func NewBooleanQuery() *BooleanQuery

NewBooleanQuery creates a new BooleanQuery.

func (*BooleanQuery) Boost Uses

func (q *BooleanQuery) Boost(boost float32) *BooleanQuery

Boost specifies the boost for this query.

func (*BooleanQuery) MarshalJSON Uses

func (q *BooleanQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

func (*BooleanQuery) Must Uses

func (q *BooleanQuery) Must(query SearchQuery) *BooleanQuery

Must specifies a query which must match.

func (*BooleanQuery) MustNot Uses

func (q *BooleanQuery) MustNot(query SearchQuery) *BooleanQuery

MustNot specifies a query which must not match.

func (*BooleanQuery) Should Uses

func (q *BooleanQuery) Should(query SearchQuery) *BooleanQuery

Should specifies a query which should match.

func (*BooleanQuery) ShouldMin Uses

func (q *BooleanQuery) ShouldMin(min int) *BooleanQuery

ShouldMin specifies the minimum value before the should query will boost.

type Bucket Uses

type Bucket struct {
    // contains filtered or unexported fields
}

Bucket represents a single bucket within a cluster.

func (*Bucket) Collection Uses

func (b *Bucket) Collection(collectionName string) *Collection

Collection returns an instance of a collection from within the default scope. Volatile: This API is subject to change at any time.

func (*Bucket) CollectionManager Uses

func (b *Bucket) CollectionManager() (*CollectionManager, error)

CollectionManager provides functions for managing collections. Volatile: This API is subject to change at any time.

func (*Bucket) DefaultCollection Uses

func (b *Bucket) DefaultCollection() *Collection

DefaultCollection returns an instance of the default collection.

func (*Bucket) Name Uses

func (b *Bucket) Name() string

Name returns the name of the bucket.

func (*Bucket) Ping Uses

func (b *Bucket) Ping(opts *PingOptions) (*PingResult, error)

Ping will ping a list of services and verify they are active and responding in an acceptable period of time.

Volatile: This API is subject to change at any time.

func (*Bucket) Scope Uses

func (b *Bucket) Scope(scopeName string) *Scope

Scope returns an instance of a Scope. Volatile: This API is subject to change at any time.

func (*Bucket) ViewIndexes Uses

func (b *Bucket) ViewIndexes() (*ViewIndexManager, error)

ViewIndexes returns a ViewIndexManager instance for managing views. Volatile: This API is subject to change at any time.

func (*Bucket) ViewQuery Uses

func (b *Bucket) ViewQuery(designDoc string, viewName string, opts *ViewOptions) (*ViewResult, error)

ViewQuery performs a view query and returns a list of rows or an error.

type BucketManager Uses

type BucketManager struct {
    // contains filtered or unexported fields
}

BucketManager provides methods for performing bucket management operations. See BucketManager for methods that allow creating and removing buckets themselves. Volatile: This API is subject to change at any time.

func (*BucketManager) CreateBucket Uses

func (bm *BucketManager) CreateBucket(settings CreateBucketSettings, opts *CreateBucketOptions) error

CreateBucket creates a bucket on the cluster.

func (*BucketManager) DropBucket Uses

func (bm *BucketManager) DropBucket(name string, opts *DropBucketOptions) error

DropBucket will delete a bucket from the cluster by name.

func (*BucketManager) FlushBucket Uses

func (bm *BucketManager) FlushBucket(name string, opts *FlushBucketOptions) error

FlushBucket will delete all the of the data from a bucket. Keep in mind that you must have flushing enabled in the buckets configuration.

func (*BucketManager) GetAllBuckets Uses

func (bm *BucketManager) GetAllBuckets(opts *GetAllBucketsOptions) (map[string]BucketSettings, error)

GetAllBuckets returns a list of all active buckets on the cluster.

func (*BucketManager) GetBucket Uses

func (bm *BucketManager) GetBucket(bucketName string, opts *GetBucketOptions) (*BucketSettings, error)

GetBucket returns settings for a bucket on the cluster.

func (*BucketManager) UpdateBucket Uses

func (bm *BucketManager) UpdateBucket(settings BucketSettings, opts *UpdateBucketOptions) error

UpdateBucket updates a bucket on the cluster.

type BucketManagerError Uses

type BucketManagerError interface {
    error
    HTTPStatus() int
    BucketNotFoundError() bool
    BucketExistsError() bool
}

BucketManagerError occurs for errors created By Couchbase Server when performing bucket management.

type BucketOptions Uses

type BucketOptions struct {
    DisableMutationTokens bool
}

BucketOptions are the options available when connecting to a Bucket.

type BucketSettings Uses

type BucketSettings struct {
    // Name is the name of the bucket and is required.
    Name string
    // FlushEnabled specifies whether or not to enable flush on the bucket.
    FlushEnabled bool
    // ReplicaIndexDisabled specifies whether or not to disable replica index.
    ReplicaIndexDisabled bool // inverted so that zero value matches server default.
    //  is the memory quota to assign to the bucket and is required.
    RAMQuotaMB int
    // NumReplicas is the number of replicas servers per vbucket and is required.
    // NOTE: If not set this will set 0 replicas.
    NumReplicas int
    // BucketType is the type of bucket this is. Defaults to CouchbaseBucketType.
    BucketType      BucketType
    EvictionPolicy  EvictionPolicyType
    MaxTTL          int
    CompressionMode CompressionMode
}

BucketSettings holds information about the settings for a bucket.

type BucketType Uses

type BucketType string

BucketType specifies the kind of bucket.

type BuildDeferredQueryIndexOptions Uses

type BuildDeferredQueryIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

BuildDeferredQueryIndexOptions is the set of options available to the query indexes BuildDeferredIndexes operation.

type BulkOp Uses

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

BulkOp represents a single operation that can be submitted (within a list of more operations) to .Do() You can create a bulk operation by instantiating one of the implementations of BulkOp, such as GetOp, UpsertOp, ReplaceOp, and more.

type BulkOpOptions Uses

type BulkOpOptions struct {
    Timeout time.Duration
    Context context.Context

    // Transcoder is used to encode values for operations that perform mutations and to decode values for
    // operations that fetch values. It does not apply to all BulkOp operations.
    Transcoder    Transcoder
    RetryStrategy RetryStrategy
}

BulkOpOptions are the set of options available when performing BulkOps using Do.

type Cas Uses

type Cas gocbcore.Cas

Cas represents the specific state of a document on the cluster.

type CertAuthenticator Uses

type CertAuthenticator struct {
}

CertAuthenticator implements an Authenticator which can be used with certificate authentication.

func (CertAuthenticator) Credentials Uses

func (ca CertAuthenticator) Credentials(req AuthCredsRequest) ([]UserPassPair, error)

Credentials returns the credentials for a particular service.

type CircuitBreakerCallback Uses

type CircuitBreakerCallback func(error) bool

CircuitBreakerCallback is the callback used by the circuit breaker to determine if an error should count toward the circuit breaker failure count.

type CircuitBreakerConfig Uses

type CircuitBreakerConfig struct {
    Disabled                 bool
    VolumeThreshold          int64
    ErrorThresholdPercentage float64
    SleepWindow              time.Duration
    RollingWindow            time.Duration
    CompletionCallback       CircuitBreakerCallback
    CanaryTimeout            time.Duration
}

CircuitBreakerConfig are the settings for configuring circuit breakers.

type Cluster Uses

type Cluster struct {
    // contains filtered or unexported fields
}

Cluster represents a connection to a specific Couchbase cluster.

func Connect Uses

func Connect(connStr string, opts ClusterOptions) (*Cluster, error)

Connect creates and returns a Cluster instance created using the provided options and connection string. The connection string properties are copied from (and should stay in sync with) the gocbcore agent.FromConnStr comment. Supported connSpecStr options are:

cacertpath (string) - Path to the CA certificate
certpath (string) - Path to your authentication certificate
keypath (string) - Path to your authentication key
config_total_timeout (int) - Maximum period to attempt to connect to cluster in ms.
config_node_timeout (int) - Maximum period to attempt to connect to a node in ms.
http_redial_period (int) - Maximum period to keep HTTP config connections open in ms.
http_retry_delay (int) - Period to wait between retrying nodes for HTTP config in ms.
config_poll_floor_interval (int) - Minimum time to wait between fetching configs via CCCP in ms.
config_poll_interval (int) - Period to wait between CCCP config polling in ms.
kv_pool_size (int) - The number of connections to establish per node.
max_queue_size (int) - The maximum size of the operation queues per node.
use_kverrmaps (bool) - Whether to enable error maps from the server.
use_enhanced_errors (bool) - Whether to enable enhanced error information.
fetch_mutation_tokens (bool) - Whether to fetch mutation tokens for operations.
compression (bool) - Whether to enable network-wise compression of documents.
compression_min_size (int) - The minimal size of the document to consider compression.
compression_min_ratio (float64) - The minimal compress ratio (compressed / original) for the document to be sent compressed.
server_duration (bool) - Whether to enable fetching server operation durations.
http_max_idle_conns (int) - Maximum number of idle http connections in the pool.
http_max_idle_conns_per_host (int) - Maximum number of idle http connections in the pool per host.
http_idle_conn_timeout (int) - Maximum length of time for an idle connection to stay in the pool in ms.
network (string) - The network type to use.
orphaned_response_logging (bool) - Whether to enable orphan response logging.
orphaned_response_logging_interval (int) - How often to log orphan responses in ms.
orphaned_response_logging_sample_size (int) - The number of samples to include in each orphaned response log.

func (*Cluster) AnalyticsIndexes Uses

func (c *Cluster) AnalyticsIndexes() (*AnalyticsIndexManager, error)

AnalyticsIndexes returns an AnalyticsIndexManager for managing analytics indexes. Volatile: This API is subject to change at any time.

func (*Cluster) AnalyticsQuery Uses

func (c *Cluster) AnalyticsQuery(statement string, opts *AnalyticsOptions) (*AnalyticsResult, error)

AnalyticsQuery performs an analytics query and returns a list of rows or an error.

func (*Cluster) Bucket Uses

func (c *Cluster) Bucket(bucketName string, opts *BucketOptions) *Bucket

Bucket connects the cluster to server(s) and returns a new Bucket instance.

func (*Cluster) Buckets Uses

func (c *Cluster) Buckets() (*BucketManager, error)

Buckets returns a BucketManager for managing buckets. Volatile: This API is subject to change at any time.

func (*Cluster) Close Uses

func (c *Cluster) Close(opts *ClusterCloseOptions) error

Close shuts down all buckets in this cluster and invalidates any references this cluster has.

func (*Cluster) Diagnostics Uses

func (c *Cluster) Diagnostics(opts *DiagnosticsOptions) (*DiagnosticsResult, error)

Diagnostics returns information about the internal state of the SDK.

Volatile: This API is subject to change at any time.

func (*Cluster) Query Uses

func (c *Cluster) Query(statement string, opts *QueryOptions) (*QueryResult, error)

Query executes the N1QL query statement on the server n1qlEp. This function assumes that `opts` already contains all the required settings. This function will inject any additional connection or request-level settings into the `opts` map (currently this is only the timeout).

func (*Cluster) QueryIndexes Uses

func (c *Cluster) QueryIndexes() (*QueryIndexManager, error)

QueryIndexes returns a QueryIndexManager for managing N1QL indexes. Volatile: This API is subject to change at any time.

func (*Cluster) SearchIndexes Uses

func (c *Cluster) SearchIndexes() (*SearchIndexManager, error)

SearchIndexes returns a SearchIndexManager for managing Search indexes. Volatile: This API is subject to change at any time.

func (*Cluster) SearchQuery Uses

func (c *Cluster) SearchQuery(indexName string, q SearchQuery, opts *SearchOptions) (*SearchResult, error)

SearchQuery performs a n1ql query and returns a list of rows or an error.

func (*Cluster) Users Uses

func (c *Cluster) Users() (*UserManager, error)

Users returns a UserManager for managing users. Volatile: This API is subject to change at any time.

type ClusterCloseOptions Uses

type ClusterCloseOptions struct {
}

ClusterCloseOptions is the set of options available when disconnecting from a Cluster.

type ClusterOptions Uses

type ClusterOptions struct {
    Authenticator     Authenticator
    ConnectTimeout    time.Duration
    KVTimeout         time.Duration
    ViewTimeout       time.Duration
    QueryTimeout      time.Duration
    AnalyticsTimeout  time.Duration
    SearchTimeout     time.Duration
    ManagementTimeout time.Duration
    // Transcoder is used for trancoding data used in KV operations.
    Transcoder Transcoder
    // Serializer is used for deserialization of data used in query, analytics, view and search operations. This
    // will default to DefaultJSONSerializer. NOTE: This is entirely independent of Transcoder.
    Serializer            JSONSerializer
    DisableMutationTokens bool
    RetryStrategy         RetryStrategy

    // Orphan logging records when the SDK receives responses for requests that are no longer in the system (usually
    // due to being timed out).
    OrphanLoggerDisabled   bool
    OrphanLoggerInterval   time.Duration
    OrphanLoggerSampleSize int

    ThresholdLoggerDisabled bool
    ThresholdLoggingOptions *ThresholdLoggingOptions

    CircuitBreakerConfig CircuitBreakerConfig
}

ClusterOptions is the set of options available for creating a Cluster.

type Collection Uses

type Collection struct {
    // contains filtered or unexported fields
}

Collection represents a single collection.

func (*Collection) Binary Uses

func (c *Collection) Binary() *BinaryCollection

Binary creates and returns a BinaryCollection object.

func (*Collection) Do Uses

func (c *Collection) Do(ops []BulkOp, opts *BulkOpOptions) error

Do execute one or more `BulkOp` items in parallel.

func (*Collection) Exists Uses

func (c *Collection) Exists(id string, opts *ExistsOptions) (docOut *ExistsResult, errOut error)

Exists checks if a document exists for the given id.

func (*Collection) Get Uses

func (c *Collection) Get(id string, opts *GetOptions) (docOut *GetResult, errOut error)

Get performs a fetch operation against the collection. This can take 3 paths, a standard full document fetch, a subdocument full document fetch also fetching document expiry (when WithExpiry is set), or a subdocument fetch (when Project is used).

func (*Collection) GetAllReplicas Uses

func (c *Collection) GetAllReplicas(id string, opts *GetAllReplicaOptions) (docOut *GetAllReplicasResult, errOut error)

GetAllReplicas returns the value of a particular document from all replica servers. This will return an iterable which streams results one at a time.

func (*Collection) GetAndLock Uses

func (c *Collection) GetAndLock(id string, lockTime time.Duration, opts *GetAndLockOptions) (docOut *GetResult, errOut error)

GetAndLock locks a document for a period of time, providing exclusive RW access to it. A lockTime value of over 30 seconds will be treated as 30 seconds. The resolution used to send this value to the server is seconds and is calculated using uint32(lockTime/time.Second).

func (*Collection) GetAndTouch Uses

func (c *Collection) GetAndTouch(id string, expiry uint32, opts *GetAndTouchOptions) (docOut *GetResult, errOut error)

GetAndTouch retrieves a document and simultaneously updates its expiry time.

func (*Collection) GetAnyReplica Uses

func (c *Collection) GetAnyReplica(id string, opts *GetAnyReplicaOptions) (docOut *GetReplicaResult, errOut error)

GetAnyReplica returns the value of a particular document from a replica server.

func (*Collection) Insert Uses

func (c *Collection) Insert(id string, val interface{}, opts *InsertOptions) (mutOut *MutationResult, errOut error)

Insert creates a new document in the Collection.

func (*Collection) List Uses

func (c *Collection) List(id string) *CouchbaseList

List returns a new CouchbaseList for the document specified by id.

func (*Collection) LookupIn Uses

func (c *Collection) LookupIn(id string, ops []LookupInSpec, opts *LookupInOptions) (docOut *LookupInResult, errOut error)

LookupIn performs a set of subdocument lookup operations on the document identified by id.

func (*Collection) Map Uses

func (c *Collection) Map(id string) *CouchbaseMap

Map returns a new CouchbaseMap.

func (*Collection) MutateIn Uses

func (c *Collection) MutateIn(id string, ops []MutateInSpec, opts *MutateInOptions) (mutOut *MutateInResult, errOut error)

MutateIn performs a set of subdocument mutations on the document specified by id.

func (*Collection) Name Uses

func (c *Collection) Name() string

Name returns the name of the collection.

func (*Collection) Queue Uses

func (c *Collection) Queue(id string) *CouchbaseQueue

Queue returns a new CouchbaseQueue.

func (*Collection) Remove Uses

func (c *Collection) Remove(id string, opts *RemoveOptions) (mutOut *MutationResult, errOut error)

Remove removes a document from the collection.

func (*Collection) Replace Uses

func (c *Collection) Replace(id string, val interface{}, opts *ReplaceOptions) (mutOut *MutationResult, errOut error)

Replace updates a document in the collection.

func (*Collection) Set Uses

func (c *Collection) Set(id string) *CouchbaseSet

Set returns a new CouchbaseSet.

func (*Collection) Touch Uses

func (c *Collection) Touch(id string, expiry uint32, opts *TouchOptions) (mutOut *MutationResult, errOut error)

Touch touches a document, specifying a new expiry time for it.

func (*Collection) Unlock Uses

func (c *Collection) Unlock(id string, cas Cas, opts *UnlockOptions) (mutOut *MutationResult, errOut error)

Unlock unlocks a document which was locked with GetAndLock.

func (*Collection) Upsert Uses

func (c *Collection) Upsert(id string, val interface{}, opts *UpsertOptions) (mutOut *MutationResult, errOut error)

Upsert creates a new document in the Collection if it does not exist, if it does exist then it updates it.

type CollectionExistsOptions Uses

type CollectionExistsOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

CollectionExistsOptions is the set of options available to the CollectionExists operation.

type CollectionManager Uses

type CollectionManager struct {
    // contains filtered or unexported fields
}

CollectionManager provides methods for performing collections management. Volatile: This API is subject to change at any time.

func (*CollectionManager) CollectionExists Uses

func (cm *CollectionManager) CollectionExists(spec CollectionSpec, opts *CollectionExistsOptions) (bool, error)

CollectionExists verifies whether or not a collection exists on the bucket.

func (*CollectionManager) CreateCollection Uses

func (cm *CollectionManager) CreateCollection(spec CollectionSpec, opts *CreateCollectionOptions) error

CreateCollection creates a new collection on the bucket.

func (*CollectionManager) CreateScope Uses

func (cm *CollectionManager) CreateScope(scopeName string, opts *CreateScopeOptions) error

CreateScope creates a new scope on the bucket.

func (*CollectionManager) DropCollection Uses

func (cm *CollectionManager) DropCollection(spec CollectionSpec, opts *DropCollectionOptions) error

DropCollection removes a collection.

func (*CollectionManager) DropScope Uses

func (cm *CollectionManager) DropScope(scopeName string, opts *DropScopeOptions) error

DropScope removes a scope.

func (*CollectionManager) GetAllScopes Uses

func (cm *CollectionManager) GetAllScopes(opts *GetAllScopesOptions) ([]ScopeSpec, error)

GetAllScopes gets all scopes from the bucket.

func (*CollectionManager) GetScope Uses

func (cm *CollectionManager) GetScope(scopeName string, opts *GetScopeOptions) (*ScopeSpec, error)

GetScope gets a scope from the bucket.

func (*CollectionManager) ScopeExists Uses

func (cm *CollectionManager) ScopeExists(scopeName string, opts *ScopeExistsOptions) (bool, error)

ScopeExists verifies whether or not a scope exists on the bucket.

type CollectionManagerError Uses

type CollectionManagerError interface {
    error
    HTTPStatus() int
    CollectionNotFoundError() bool
    CollectionExistsError() bool
    ScopeNotFoundError() bool
    ScopeExistsError() bool
}

CollectionManagerError occurs for errors created By Couchbase Server when performing collection management.

type CollectionNotFoundError Uses

type CollectionNotFoundError interface {
    CollectionNotFound() bool
}

CollectionNotFoundError returns whether or not an error occurred because a collection could not be found.

type CollectionSpec Uses

type CollectionSpec struct {
    Name      string
    ScopeName string
}

CollectionSpec describes the specification of a collection.

type CompressionMode Uses

type CompressionMode string

CompressionMode specifies the kind of compression to use for a bucket.

type ConfigurationError Uses

type ConfigurationError interface {
    error
    ConfigurationError() bool
}

ConfigurationError occurs when the client is configured incorrectly.

type ConflictResolutionType Uses

type ConflictResolutionType string

ConflictResolutionType specifies the kind of conflict resolution to use for a bucket.

type ConjunctionQuery Uses

type ConjunctionQuery struct {
    // contains filtered or unexported fields
}

ConjunctionQuery represents a FTS conjunction query.

func NewConjunctionQuery Uses

func NewConjunctionQuery(queries ...SearchQuery) *ConjunctionQuery

NewConjunctionQuery creates a new ConjunctionQuery.

func (*ConjunctionQuery) And Uses

func (q *ConjunctionQuery) And(queries ...SearchQuery) *ConjunctionQuery

And adds new predicate queries to this conjunction query.

func (*ConjunctionQuery) Boost Uses

func (q *ConjunctionQuery) Boost(boost float32) *ConjunctionQuery

Boost specifies the boost for this query.

func (ConjunctionQuery) MarshalJSON Uses

func (q ConjunctionQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type ConnectAnalyticsLinkOptions Uses

type ConnectAnalyticsLinkOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
    // Name of the link, if empty defaults to Local
    LinkName string
}

ConnectAnalyticsLinkOptions is the set of options available to the AnalyticsManager ConnectLink operation.

type CouchbaseList Uses

type CouchbaseList struct {
    // contains filtered or unexported fields
}

CouchbaseList represents a list document.

func (*CouchbaseList) Append Uses

func (cl *CouchbaseList) Append(val interface{}) error

Append appends an item to the list.

func (*CouchbaseList) At Uses

func (cl *CouchbaseList) At(index int, valuePtr interface{}) error

At retrieves the value specified at the given index from the list.

func (*CouchbaseList) Clear Uses

func (cl *CouchbaseList) Clear() error

Clear clears a list, also removing it.

func (*CouchbaseList) IndexOf Uses

func (cl *CouchbaseList) IndexOf(val interface{}) (int, error)

IndexOf gets the index of the item in the list.

func (*CouchbaseList) Iterator Uses

func (cl *CouchbaseList) Iterator() ([]interface{}, error)

Iterator returns an iterable for all items in the list.

func (*CouchbaseList) Prepend Uses

func (cl *CouchbaseList) Prepend(val interface{}) error

Prepend prepends an item to the list.

func (*CouchbaseList) RemoveAt Uses

func (cl *CouchbaseList) RemoveAt(index int) error

RemoveAt removes the value specified at the given index from the list.

func (*CouchbaseList) Size Uses

func (cl *CouchbaseList) Size() (int, error)

Size returns the size of the list.

type CouchbaseMap Uses

type CouchbaseMap struct {
    // contains filtered or unexported fields
}

CouchbaseMap represents a map document.

func (*CouchbaseMap) Add Uses

func (cl *CouchbaseMap) Add(id string, val interface{}) error

Add adds an item to the map.

func (*CouchbaseMap) At Uses

func (cl *CouchbaseMap) At(id string, valuePtr interface{}) error

At retrieves the item for the given id from the map.

func (*CouchbaseMap) Clear Uses

func (cl *CouchbaseMap) Clear() error

Clear clears a map, also removing it.

func (*CouchbaseMap) Exists Uses

func (cl *CouchbaseMap) Exists(id string) (bool, error)

Exists verifies whether or a id exists in the map.

func (*CouchbaseMap) Iterator Uses

func (cl *CouchbaseMap) Iterator() (map[string]interface{}, error)

Iterator returns an iterable for all items in the map.

func (*CouchbaseMap) Keys Uses

func (cl *CouchbaseMap) Keys() ([]string, error)

Keys returns all of the keys within the map.

func (*CouchbaseMap) Remove Uses

func (cl *CouchbaseMap) Remove(id string) error

Remove removes an item from the map.

func (*CouchbaseMap) Size Uses

func (cl *CouchbaseMap) Size() (int, error)

Size returns the size of the map.

func (*CouchbaseMap) Values Uses

func (cl *CouchbaseMap) Values() ([]interface{}, error)

Values returns all of the values within the map.

type CouchbaseQueue Uses

type CouchbaseQueue struct {
    // contains filtered or unexported fields
}

CouchbaseQueue represents a queue document.

func (*CouchbaseQueue) Clear Uses

func (cs *CouchbaseQueue) Clear() error

Clear clears a queue, also removing it.

func (*CouchbaseQueue) Iterator Uses

func (cs *CouchbaseQueue) Iterator() ([]interface{}, error)

Iterator returns an iterable for all items in the queue.

func (*CouchbaseQueue) Pop Uses

func (cs *CouchbaseQueue) Pop(valuePtr interface{}) error

Pop pops an items off of the queue.

func (*CouchbaseQueue) Push Uses

func (cs *CouchbaseQueue) Push(val interface{}) error

Push pushes a value onto the queue.

func (*CouchbaseQueue) Size Uses

func (cs *CouchbaseQueue) Size() (int, error)

Size returns the size of the queue.

type CouchbaseSet Uses

type CouchbaseSet struct {
    // contains filtered or unexported fields
}

CouchbaseSet represents a set document.

func (*CouchbaseSet) Add Uses

func (cs *CouchbaseSet) Add(val interface{}) error

Add adds a value to the set.

func (*CouchbaseSet) Clear Uses

func (cs *CouchbaseSet) Clear() error

Clear clears a set, also removing it.

func (*CouchbaseSet) Contains Uses

func (cs *CouchbaseSet) Contains(val string) (bool, error)

Contains verifies whether or not a value exists within the set.

func (*CouchbaseSet) Iterator Uses

func (cs *CouchbaseSet) Iterator() ([]interface{}, error)

Iterator returns an iterable for all items in the set.

func (*CouchbaseSet) Remove Uses

func (cs *CouchbaseSet) Remove(val string) error

Remove removes an value from the set.

func (*CouchbaseSet) Size Uses

func (cs *CouchbaseSet) Size() (int, error)

Size returns the size of the set

func (*CouchbaseSet) Values Uses

func (cs *CouchbaseSet) Values() ([]interface{}, error)

Values returns all of the values within the set.

type CountSpecOptions Uses

type CountSpecOptions struct {
    IsXattr bool
}

CountSpecOptions are the options available to LookupIn subdoc Count operations.

type CounterOptions Uses

type CounterOptions struct {
    Timeout time.Duration
    Context context.Context
    // Expiry is the length of time in seconds that the document will be stored in Couchbase.
    // A value of 0 will set the document to never expire.
    Expiry uint32
    // Initial, if non-negative, is the `initial` value to use for the document if it does not exist.
    // If present, this is the value that will be returned by a successful operation.
    Initial int64
    // Delta is the value to use for incrementing/decrementing if Initial is not present.
    Delta           uint64
    DurabilityLevel DurabilityLevel
    PersistTo       uint
    ReplicateTo     uint
    Cas             Cas
    RetryStrategy   RetryStrategy
}

CounterOptions are the options available to the Counter operation.

type CounterResult Uses

type CounterResult struct {
    MutationResult
    // contains filtered or unexported fields
}

CounterResult is the return type of counter operations.

func (CounterResult) Cas Uses

func (mr CounterResult) Cas() Cas

Cas returns the Cas value for a document following an operation.

func (CounterResult) Content Uses

func (mr CounterResult) Content() uint64

Content returns the new value for the counter document.

func (CounterResult) MutationToken Uses

func (mr CounterResult) MutationToken() *MutationToken

MutationToken returns the mutation token belonging to an operation.

type CounterSpecOptions Uses

type CounterSpecOptions struct {
    CreatePath bool
    IsXattr    bool
}

CounterSpecOptions are the options available to subdocument Increment and Decrement operations.

type CreateAnalyticsDatasetOptions Uses

type CreateAnalyticsDatasetOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    IgnoreIfExists bool
    // Condition can be used to set the WHERE clause for the dataset creation.
    Condition     string
    DataverseName string
}

CreateAnalyticsDatasetOptions is the set of options available to the AnalyticsManager CreateDataset operation.

type CreateAnalyticsDataverseOptions Uses

type CreateAnalyticsDataverseOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    IgnoreIfExists bool
}

CreateAnalyticsDataverseOptions is the set of options available to the AnalyticsManager CreateDataverse operation.

type CreateAnalyticsIndexOptions Uses

type CreateAnalyticsIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    IgnoreIfExists bool
    DataverseName  string
}

CreateAnalyticsIndexOptions is the set of options available to the AnalyticsManager CreateIndex operation.

type CreateBucketOptions Uses

type CreateBucketOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

CreateBucketOptions is the set of options available to the bucket manager CreateBucket operation.

type CreateBucketSettings Uses

type CreateBucketSettings struct {
    BucketSettings
    ConflictResolutionType ConflictResolutionType
}

CreateBucketSettings are the settings available when creating a bucket.

type CreateCollectionOptions Uses

type CreateCollectionOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

CreateCollectionOptions is the set of options available to the CreateCollection operation.

type CreatePrimaryQueryIndexOptions Uses

type CreatePrimaryQueryIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    IgnoreIfExists bool
    Deferred       bool
    CustomName     string
}

CreatePrimaryQueryIndexOptions is the set of options available to the query indexes CreatePrimaryIndex operation.

type CreateQueryIndexOptions Uses

type CreateQueryIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    IgnoreIfExists bool
    Deferred       bool
}

CreateQueryIndexOptions is the set of options available to the query indexes CreateIndex operation.

type CreateScopeOptions Uses

type CreateScopeOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

CreateScopeOptions is the set of options available to the CreateScope operation.

type DateFacet Uses

type DateFacet struct {
    // contains filtered or unexported fields
}

DateFacet is an FTS date range facet.

func NewDateFacet Uses

func NewDateFacet(field string, size int) *DateFacet

NewDateFacet creates a new date range facet.

func (*DateFacet) AddRange Uses

func (f *DateFacet) AddRange(name string, start, end string) *DateFacet

AddRange adds a new range to this date range facet.

func (DateFacet) MarshalJSON Uses

func (f DateFacet) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this facet to JSON for the FTS REST API.

type DateFacetResult Uses

type DateFacetResult struct {
    Name  string `json:"name,omitempty"`
    Min   string `json:"min,omitempty"`
    Max   string `json:"max,omitempty"`
    Count int    `json:"count,omitempty"`
}

DateFacetResult holds the results of a date facet in search results.

type DateRangeQuery Uses

type DateRangeQuery struct {
    // contains filtered or unexported fields
}

DateRangeQuery represents a FTS date range query.

func NewDateRangeQuery Uses

func NewDateRangeQuery() *DateRangeQuery

NewDateRangeQuery creates a new DateRangeQuery.

func (*DateRangeQuery) Boost Uses

func (q *DateRangeQuery) Boost(boost float32) *DateRangeQuery

Boost specifies the boost for this query.

func (*DateRangeQuery) DateTimeParser Uses

func (q *DateRangeQuery) DateTimeParser(parser string) *DateRangeQuery

DateTimeParser specifies which date time string parser to use.

func (*DateRangeQuery) End Uses

func (q *DateRangeQuery) End(end string, inclusive bool) *DateRangeQuery

End specifies the end value and inclusiveness for this range query.

func (*DateRangeQuery) Field Uses

func (q *DateRangeQuery) Field(field string) *DateRangeQuery

Field specifies the field for this query.

func (DateRangeQuery) MarshalJSON Uses

func (q DateRangeQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

func (*DateRangeQuery) Start Uses

func (q *DateRangeQuery) Start(start string, inclusive bool) *DateRangeQuery

Start specifies the start value and inclusiveness for this range query.

type DecrementOp Uses

type DecrementOp struct {
    ID      string
    Delta   int64
    Initial int64
    Expiry  uint32

    Result *CounterResult
    Err    error
    // contains filtered or unexported fields
}

DecrementOp represents a type of `BulkOp` used for Decrement operations. See BulkOp.

type DefaultJSONSerializer Uses

type DefaultJSONSerializer struct {
}

DefaultJSONSerializer implements the JSONSerializer interface using json.Marshal/Unmarshal.

func (*DefaultJSONSerializer) Deserialize Uses

func (s *DefaultJSONSerializer) Deserialize(bytes []byte, out interface{}) error

Deserialize applies the json.Unmarshal behaviour to deserialize into a Go type

func (*DefaultJSONSerializer) Serialize Uses

func (s *DefaultJSONSerializer) Serialize(value interface{}) ([]byte, error)

Serialize applies the json.Marshal behaviour to serialize a Go type

type DesignDocument Uses

type DesignDocument struct {
    Name  string          `json:"-"`
    Views map[string]View `json:"views,omitempty"`
}

DesignDocument represents a Couchbase design document containing multiple views.

type DesignDocumentNamespace Uses

type DesignDocumentNamespace bool

DesignDocumentNamespace represents which namespace a design document resides in.

type DiagConnState Uses

type DiagConnState int

DiagConnState represents the state of a connection in a diagnostics report.

type DiagnosticsOptions Uses

type DiagnosticsOptions struct {
    ReportID string
}

DiagnosticsOptions are the options that are available for use with the Diagnostics operation.

type DiagnosticsResult Uses

type DiagnosticsResult struct {
    ID       string
    Version  int64
    SDK      string
    Services map[string][]EndPointDiagnostics
}

DiagnosticsResult encapsulates the results of a Diagnostics operation.

func (*DiagnosticsResult) MarshalJSON Uses

func (report *DiagnosticsResult) MarshalJSON() ([]byte, error)

MarshalJSON generates a JSON representation of this diagnostics report.

type DisallowQueryingSearchIndexOptions Uses

type DisallowQueryingSearchIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

DisallowQueryingSearchIndexOptions is the set of options available to the search index DisallowQuerying operation.

type DisconnectAnalyticsLinkOptions Uses

type DisconnectAnalyticsLinkOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
    // Name of the link, if empty defaults to Local
    LinkName string
}

DisconnectAnalyticsLinkOptions is the set of options available to the AnalyticsManager DisconnectLink operation.

type DisjunctionQuery Uses

type DisjunctionQuery struct {
    // contains filtered or unexported fields
}

DisjunctionQuery represents a FTS disjunction query.

func NewDisjunctionQuery Uses

func NewDisjunctionQuery(queries ...SearchQuery) *DisjunctionQuery

NewDisjunctionQuery creates a new DisjunctionQuery.

func (*DisjunctionQuery) Boost Uses

func (q *DisjunctionQuery) Boost(boost float32) *DisjunctionQuery

Boost specifies the boost for this query.

func (DisjunctionQuery) MarshalJSON Uses

func (q DisjunctionQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

func (*DisjunctionQuery) Or Uses

func (q *DisjunctionQuery) Or(queries ...SearchQuery) *DisjunctionQuery

Or adds new predicate queries to this disjunction query.

type DocIdQuery Uses

type DocIdQuery struct {
    // contains filtered or unexported fields
}

DocIdQuery represents a FTS document id query.

func NewDocIdQuery Uses

func NewDocIdQuery(ids ...string) *DocIdQuery

NewDocIdQuery creates a new DocIdQuery.

func (*DocIdQuery) AddDocIds Uses

func (q *DocIdQuery) AddDocIds(ids ...string) *DocIdQuery

AddDocIds adds addition document ids to this query.

func (*DocIdQuery) Boost Uses

func (q *DocIdQuery) Boost(boost float32) *DocIdQuery

Boost specifies the boost for this query.

func (*DocIdQuery) Field Uses

func (q *DocIdQuery) Field(field string) *DocIdQuery

Field specifies the field for this query.

func (DocIdQuery) MarshalJSON Uses

func (q DocIdQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type DropAnalyticsDatasetOptions Uses

type DropAnalyticsDatasetOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    IgnoreIfNotExists bool
    DataverseName     string
}

DropAnalyticsDatasetOptions is the set of options available to the AnalyticsManager DropDataset operation.

type DropAnalyticsDataverseOptions Uses

type DropAnalyticsDataverseOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    IgnoreIfNotExists bool
}

DropAnalyticsDataverseOptions is the set of options available to the AnalyticsManager DropDataverse operation.

type DropAnalyticsIndexOptions Uses

type DropAnalyticsIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    IgnoreIfNotExists bool
    DataverseName     string
}

DropAnalyticsIndexOptions is the set of options available to the AnalyticsManager DropIndex operation.

type DropBucketOptions Uses

type DropBucketOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

DropBucketOptions is the set of options available to the bucket manager DropBucket operation.

type DropCollectionOptions Uses

type DropCollectionOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

DropCollectionOptions is the set of options available to the DropCollection operation.

type DropDesignDocumentOptions Uses

type DropDesignDocumentOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

DropDesignDocumentOptions is the set of options available to the ViewIndexManager Upsert operation.

type DropGroupOptions Uses

type DropGroupOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

DropGroupOptions is the set of options available to the group manager Drop operation.

type DropPrimaryQueryIndexOptions Uses

type DropPrimaryQueryIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    IgnoreIfNotExists bool
    CustomName        string
}

DropPrimaryQueryIndexOptions is the set of options available to the query indexes DropPrimaryIndex operation.

type DropQueryIndexOptions Uses

type DropQueryIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    IgnoreIfNotExists bool
}

DropQueryIndexOptions is the set of options available to the query indexes DropIndex operation.

type DropScopeOptions Uses

type DropScopeOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

DropScopeOptions is the set of options available to the DropScope operation.

type DropSearchIndexOptions Uses

type DropSearchIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

DropSearchIndexOptions is the set of options available to the search index DropIndex operation.

type DropUserOptions Uses

type DropUserOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    DomainName string
}

DropUserOptions is the set of options available to the user manager Drop operation.

type DurabilityError Uses

type DurabilityError interface {
    DurabilityError() bool
}

DurabilityError occurs when an error occurs during performing durability operations.

type DurabilityLevel Uses

type DurabilityLevel uint8

DurabilityLevel specifies the level of synchronous replication to use.

type EndPointDiagnostics Uses

type EndPointDiagnostics struct {
    Type         ServiceType
    State        DiagConnState
    Local        string
    Remote       string
    LastActivity time.Time
    Scope        string
    ID           string
}

EndPointDiagnostics represents a single entry in a diagnostics report.

type EvictionPolicyType Uses

type EvictionPolicyType string

EvictionPolicyType specifies the kind of eviction policy to use for a bucket.

type ExistsOptions Uses

type ExistsOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

ExistsOptions are the options available to the Exists command.

type ExistsResult Uses

type ExistsResult struct {
    Result
    // contains filtered or unexported fields
}

ExistsResult is the return type of Exist operations.

func (*ExistsResult) Exists Uses

func (d *ExistsResult) Exists() bool

Exists returns whether or not the document exists.

type ExistsSpecOptions Uses

type ExistsSpecOptions struct {
    IsXattr bool
}

ExistsSpecOptions are the options available to LookupIn subdoc Exists operations.

type FacetResult Uses

type FacetResult struct {
    Field         string               `json:"field,omitempty"`
    Total         int                  `json:"total,omitempty"`
    Missing       int                  `json:"missing,omitempty"`
    Other         int                  `json:"other,omitempty"`
    Terms         []TermFacetResult    `json:"terms,omitempty"`
    NumericRanges []NumericFacetResult `json:"numeric_ranges,omitempty"`
    DateRanges    []DateFacetResult    `json:"date_ranges,omitempty"`
}

FacetResult holds the results of a specified facet in search results.

type FailFastRetryStrategy Uses

type FailFastRetryStrategy struct {
}

FailFastRetryStrategy represents a strategy that will never retry.

func NewFailFastRetryStrategy Uses

func NewFailFastRetryStrategy() *FailFastRetryStrategy

NewFailFastRetryStrategy returns a new FailFastRetryStrategy.

func (*FailFastRetryStrategy) RetryAfter Uses

func (rs *FailFastRetryStrategy) RetryAfter(req RetryRequest, reason RetryReason) RetryAction

RetryAfter calculates and returns a RetryAction describing how long to wait before retrying an operation.

type FeatureNotFoundError Uses

type FeatureNotFoundError interface {
    error
    FeatureNotFoundError() bool
}

FeatureNotFoundError indicates that an error occurred because the requested feature is not supported by the server.

type FlushBucketOptions Uses

type FlushBucketOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

FlushBucketOptions is the set of options available to the bucket manager FlushBucket operation.

type FreezePlanSearchIndexOptions Uses

type FreezePlanSearchIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

FreezePlanSearchIndexOptions is the set of options available to the search index FreezePlan operation.

type FtsFacet Uses

type FtsFacet interface {
}

FtsFacet represents a facet for a search query.

type FtsSort Uses

type FtsSort interface {
}

FtsSort represents an FTS sorting for a search query.

type GeoBoundingBoxQuery Uses

type GeoBoundingBoxQuery struct {
    // contains filtered or unexported fields
}

GeoBoundingBoxQuery represents a FTS geographical bounding box query.

func NewGeoBoundingBoxQuery Uses

func NewGeoBoundingBoxQuery(tlLon, tlLat, brLon, brLat float64) *GeoBoundingBoxQuery

NewGeoBoundingBoxQuery creates a new GeoBoundingBoxQuery.

func (*GeoBoundingBoxQuery) Boost Uses

func (q *GeoBoundingBoxQuery) Boost(boost float32) *GeoBoundingBoxQuery

Boost specifies the boost for this query.

func (*GeoBoundingBoxQuery) Field Uses

func (q *GeoBoundingBoxQuery) Field(field string) *GeoBoundingBoxQuery

Field specifies the field for this query.

func (GeoBoundingBoxQuery) MarshalJSON Uses

func (q GeoBoundingBoxQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type GeoDistanceQuery Uses

type GeoDistanceQuery struct {
    // contains filtered or unexported fields
}

GeoDistanceQuery represents a FTS geographical distance query.

func NewGeoDistanceQuery Uses

func NewGeoDistanceQuery(lon, lat float64, distance string) *GeoDistanceQuery

NewGeoDistanceQuery creates a new GeoDistanceQuery.

func (*GeoDistanceQuery) Boost Uses

func (q *GeoDistanceQuery) Boost(boost float32) *GeoDistanceQuery

Boost specifies the boost for this query.

func (*GeoDistanceQuery) Field Uses

func (q *GeoDistanceQuery) Field(field string) *GeoDistanceQuery

Field specifies the field for this query.

func (GeoDistanceQuery) MarshalJSON Uses

func (q GeoDistanceQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type GetAllAnalyticsDatasetsOptions Uses

type GetAllAnalyticsDatasetsOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetAllAnalyticsDatasetsOptions is the set of options available to the AnalyticsManager GetAllDatasets operation.

type GetAllAnalyticsIndexesOptions Uses

type GetAllAnalyticsIndexesOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetAllAnalyticsIndexesOptions is the set of options available to the AnalyticsManager GetAllIndexes operation.

type GetAllBucketsOptions Uses

type GetAllBucketsOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetAllBucketsOptions is the set of options available to the bucket manager GetAll operation.

type GetAllDesignDocumentsOptions Uses

type GetAllDesignDocumentsOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetAllDesignDocumentsOptions is the set of options available to the ViewIndexManager GetAllDesignDocuments operation.

type GetAllGroupsOptions Uses

type GetAllGroupsOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetAllGroupsOptions is the set of options available to the group manager GetAll operation.

type GetAllQueryIndexesOptions Uses

type GetAllQueryIndexesOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetAllQueryIndexesOptions is the set of options available to the query indexes GetAllIndexes operation.

type GetAllReplicaOptions Uses

type GetAllReplicaOptions struct {
    Timeout       time.Duration
    Context       context.Context
    Transcoder    Transcoder
    RetryStrategy RetryStrategy
}

GetAllReplicaOptions are the options available to the GetAllReplicas command.

type GetAllReplicasResult Uses

type GetAllReplicasResult struct {
    // contains filtered or unexported fields
}

GetAllReplicasResult is the return type of GetAllReplica operations.

func (*GetAllReplicasResult) Close Uses

func (r *GetAllReplicasResult) Close() error

Close ends the stream and returns any errors that occurred.

func (*GetAllReplicasResult) Next Uses

func (r *GetAllReplicasResult) Next(valuePtr *GetReplicaResult) bool

Next fetches the new replica.

type GetAllScopesOptions Uses

type GetAllScopesOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetAllScopesOptions is the set of options available to the GetAllScopes operation.

type GetAllSearchIndexOptions Uses

type GetAllSearchIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetAllSearchIndexOptions is the set of options available to the search indexes GetAllIndexes operation.

type GetAllUsersOptions Uses

type GetAllUsersOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    DomainName string
}

GetAllUsersOptions is the set of options available to the user manager GetAll operation.

type GetAndLockOptions Uses

type GetAndLockOptions struct {
    Timeout       time.Duration
    Context       context.Context
    Transcoder    Transcoder
    RetryStrategy RetryStrategy
}

GetAndLockOptions are the options available to the GetAndLock operation.

type GetAndTouchOp Uses

type GetAndTouchOp struct {
    ID     string
    Expiry uint32
    Result *GetResult
    Err    error
    // contains filtered or unexported fields
}

GetAndTouchOp represents a type of `BulkOp` used for GetAndTouch operations. See BulkOp.

type GetAndTouchOptions Uses

type GetAndTouchOptions struct {
    Timeout       time.Duration
    Context       context.Context
    Transcoder    Transcoder
    RetryStrategy RetryStrategy
}

GetAndTouchOptions are the options available to the GetAndTouch operation.

type GetAnyReplicaOptions Uses

type GetAnyReplicaOptions struct {
    Timeout       time.Duration
    Context       context.Context
    Transcoder    Transcoder
    RetryStrategy RetryStrategy
}

GetAnyReplicaOptions are the options available to the GetAnyReplica command.

type GetBucketOptions Uses

type GetBucketOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetBucketOptions is the set of options available to the bucket manager GetBucket operation.

type GetDesignDocumentOptions Uses

type GetDesignDocumentOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetDesignDocumentOptions is the set of options available to the ViewIndexManager GetDesignDocument operation.

type GetGroupOptions Uses

type GetGroupOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetGroupOptions is the set of options available to the group manager Get operation.

type GetIndexedDocumentsCountOptions Uses

type GetIndexedDocumentsCountOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetIndexedDocumentsCountOptions is the set of options available to the search index GetIndexedDocumentsCount operation.

type GetOp Uses

type GetOp struct {
    ID     string
    Result *GetResult
    Err    error
    // contains filtered or unexported fields
}

GetOp represents a type of `BulkOp` used for Get operations. See BulkOp.

type GetOptions Uses

type GetOptions struct {
    Timeout    time.Duration
    Context    context.Context
    WithExpiry bool
    // Project causes the Get operation to only fetch the fields indicated
    // by the paths. The result of the operation is then treated as a
    // standard GetResult.
    Project       []string
    Transcoder    Transcoder
    RetryStrategy RetryStrategy
}

GetOptions are the options available to a Get operation.

type GetPendingMutationsAnalyticsOptions Uses

type GetPendingMutationsAnalyticsOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetPendingMutationsAnalyticsOptions is the set of options available to the user manager GetPendingMutations operation.

type GetReplicaResult Uses

type GetReplicaResult struct {
    GetResult
    // contains filtered or unexported fields
}

GetReplicaResult is the return type of GetReplica operations.

func (*GetReplicaResult) IsReplica Uses

func (r *GetReplicaResult) IsReplica() bool

IsReplica returns whether or not this result came from a replica server.

type GetResult Uses

type GetResult struct {
    Result
    // contains filtered or unexported fields
}

GetResult is the return type of Get operations.

func (*GetResult) Content Uses

func (d *GetResult) Content(valuePtr interface{}) error

Content assigns the value of the result into the valuePtr using default decoding.

func (*GetResult) Expiry Uses

func (d *GetResult) Expiry() *uint32

Expiry returns the expiry value for the result.

type GetRolesOptions Uses

type GetRolesOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetRolesOptions is the set of options available to the user manager GetRoles operation.

type GetScopeOptions Uses

type GetScopeOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetScopeOptions is the set of options available to the GetScope operation.

type GetSearchIndexOptions Uses

type GetSearchIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

GetSearchIndexOptions is the set of options available to the search indexes GetIndex operation.

type GetSpecOptions Uses

type GetSpecOptions struct {
    IsXattr bool
}

GetSpecOptions are the options available to LookupIn subdoc Get operations.

type GetUserOptions Uses

type GetUserOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    DomainName string
}

GetUserOptions is the set of options available to the user manager Get operation.

type Group Uses

type Group struct {
    Name               string `json:"id"`
    Description        string `json:"description"`
    Roles              []Role `json:"roles"`
    LDAPGroupReference string `json:"ldap_group_ref"`
}

Group represents a user group on the server.

type HTTPError Uses

type HTTPError interface {
    error
    HTTPStatus() int
}

HTTPError indicates that an error occurred with a valid HTTP response for an operation.

type IncrementOp Uses

type IncrementOp struct {
    ID      string
    Delta   int64
    Initial int64
    Expiry  uint32

    Result *CounterResult
    Err    error
    // contains filtered or unexported fields
}

IncrementOp represents a type of `BulkOp` used for Increment operations. See BulkOp.

type IndexType Uses

type IndexType string

IndexType provides information on the type of indexer used for an index.

type InsertOp Uses

type InsertOp struct {
    ID     string
    Value  interface{}
    Expiry uint32
    Result *MutationResult
    Err    error
    // contains filtered or unexported fields
}

InsertOp represents a type of `BulkOp` used for Insert operations. See BulkOp.

type InsertOptions Uses

type InsertOptions struct {
    Timeout time.Duration
    Context context.Context
    // The expiry length in seconds
    Expiry          uint32
    PersistTo       uint
    ReplicateTo     uint
    DurabilityLevel DurabilityLevel
    Transcoder      Transcoder
    RetryStrategy   RetryStrategy
}

InsertOptions are options that can be applied to an Insert operation.

type InsertSpecOptions Uses

type InsertSpecOptions struct {
    CreatePath bool
    IsXattr    bool
}

InsertSpecOptions are the options available to subdocument Insert operations.

type InvalidArgumentsError Uses

type InvalidArgumentsError interface {
    error
    InvalidArgumentsError() bool
}

InvalidArgumentsError indicates that invalid arguments were provided to an operation.

type InvalidIndexError Uses

type InvalidIndexError interface {
    InvalidIndex() bool
}

InvalidIndexError occurs when an invalid index is specified on a LookupInResult.

type JSONSerializer Uses

type JSONSerializer interface {
    // Serialize serializes an interface into bytes.
    Serialize(value interface{}) ([]byte, error)

    // Deserialize deserializes json bytes into an interface.
    Deserialize(bytes []byte, out interface{}) error
}

JSONSerializer is used a Transcoder for serialization/deserialization of JSON datatype valuess

type JSONTranscoder Uses

type JSONTranscoder struct {
    // contains filtered or unexported fields
}

JSONTranscoder implements the default transcoding behavior and applies JSON transcoding to all values.

This will apply the following behavior to the value: binary ([]byte) -> error. default -> JSON value, JSON Flags.

func NewJSONTranscoder Uses

func NewJSONTranscoder(serializer JSONSerializer) *JSONTranscoder

NewJSONTranscoder returns a new JSONTranscoder initialized to use the specified serializer. If the serializer is nil then it will use the DefaultJSONSerializer.

func (*JSONTranscoder) Decode Uses

func (t *JSONTranscoder) Decode(bytes []byte, flags uint32, out interface{}) error

Decode applies JSON transcoding behaviour to decode into a Go type.

func (*JSONTranscoder) Encode Uses

func (t *JSONTranscoder) Encode(value interface{}) ([]byte, uint32, error)

Encode applies JSON transcoding behaviour to encode a Go type.

type KeyValueError Uses

type KeyValueError interface {
    error
    ID() string
    StatusCode() int // ?
    Opaque() uint32
    KeyValueError() bool
}

KeyValueError represents an error that occurred while executing a K/V operation. Assumes that the service has returned a response.

type LegacyTranscoder Uses

type LegacyTranscoder struct {
    // contains filtered or unexported fields
}

LegacyTranscoder implements the behaviour for a backward-compatible transcoder. This transcoder implements behaviour matching that of gocb v1.

This will apply the following behavior to the value: binary ([]byte) -> binary bytes, Binary expectedFlags. string -> string bytes, String expectedFlags. default -> JSON value, JSON expectedFlags.

func NewLegacyTranscoder Uses

func NewLegacyTranscoder(serializer JSONSerializer) *LegacyTranscoder

NewLegacyTranscoder returns a new LegacyTranscoder initialized to use the specified serializer. If the serializer is nil then it will use the DefaultJSONSerializer.

func (*LegacyTranscoder) Decode Uses

func (t *LegacyTranscoder) Decode(bytes []byte, flags uint32, out interface{}) error

Decode applies legacy transcoding behaviour to decode into a Go type.

func (*LegacyTranscoder) Encode Uses

func (t *LegacyTranscoder) Encode(value interface{}) ([]byte, uint32, error)

Encode applies legacy transcoding behavior to encode a Go type.

type LogLevel Uses

type LogLevel gocbcore.LogLevel

LogLevel specifies the severity of a log message.

type LogRedactLevel Uses

type LogRedactLevel int

LogRedactLevel specifies the degree with which to redact the logs.

type Logger Uses

type Logger interface {
    // Outputs logging information:
    // level is the verbosity level
    // offset is the position within the calling stack from which the message
    // originated. This is useful for contextual loggers which retrieve file/line
    // information.
    Log(level LogLevel, offset int, format string, v ...interface{}) error
}

Logger defines a logging interface. You can either use one of the default loggers (DefaultStdioLogger(), VerboseStdioLogger()) or implement your own.

func DefaultStdioLogger Uses

func DefaultStdioLogger() Logger

DefaultStdioLogger gets the default standard I/O logger.

gocb.SetLogger(gocb.DefaultStdioLogger())

func VerboseStdioLogger Uses

func VerboseStdioLogger() Logger

VerboseStdioLogger is a more verbose level of DefaultStdioLogger(). Messages pertaining to the scheduling of ordinary commands (and their responses) will also be emitted.

gocb.SetLogger(gocb.VerboseStdioLogger())

type LookupInOptions Uses

type LookupInOptions struct {
    Context       context.Context
    Timeout       time.Duration
    Serializer    JSONSerializer
    RetryStrategy RetryStrategy
}

LookupInOptions are the set of options available to LookupIn.

type LookupInResult Uses

type LookupInResult struct {
    Result
    // contains filtered or unexported fields
}

LookupInResult is the return type for LookupIn.

func (*LookupInResult) ContentAt Uses

func (lir *LookupInResult) ContentAt(idx int, valuePtr interface{}) error

ContentAt retrieves the value of the operation by its index. The index is the position of the operation as it was added to the builder.

func (*LookupInResult) Exists Uses

func (lir *LookupInResult) Exists(idx int) bool

Exists verifies that the item at idx exists.

type LookupInSpec Uses

type LookupInSpec struct {
    // contains filtered or unexported fields
}

LookupInSpec is the representation of an operation available when calling LookupIn

func CountSpec Uses

func CountSpec(path string, opts *CountSpecOptions) LookupInSpec

CountSpec allows you to retrieve the number of items in an array or keys within an dictionary within an element of a document.

func ExistsSpec Uses

func ExistsSpec(path string, opts *ExistsSpecOptions) LookupInSpec

ExistsSpec is similar to Path(), but does not actually retrieve the value from the server. This may save bandwidth if you only need to check for the existence of a path (without caring for its content). You can check the status of this operation by using .ContentAt (and ignoring the value) or .Exists() on the LookupResult.

func GetSpec Uses

func GetSpec(path string, opts *GetSpecOptions) LookupInSpec

GetSpec indicates a path to be retrieved from the document. The value of the path can later be retrieved from the LookupResult. The path syntax follows N1QL's path syntax (e.g. `foo.bar.baz`).

type MatchAllQuery Uses

type MatchAllQuery struct {
    // contains filtered or unexported fields
}

MatchAllQuery represents a FTS match all query.

func NewMatchAllQuery Uses

func NewMatchAllQuery() *MatchAllQuery

NewMatchAllQuery creates a new MatchAllQuery.

func (MatchAllQuery) MarshalJSON Uses

func (q MatchAllQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type MatchNoneQuery Uses

type MatchNoneQuery struct {
    // contains filtered or unexported fields
}

MatchNoneQuery represents a FTS match none query.

func NewMatchNoneQuery Uses

func NewMatchNoneQuery() *MatchNoneQuery

NewMatchNoneQuery creates a new MatchNoneQuery.

func (MatchNoneQuery) MarshalJSON Uses

func (q MatchNoneQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type MatchPhraseQuery Uses

type MatchPhraseQuery struct {
    // contains filtered or unexported fields
}

MatchPhraseQuery represents a FTS match phrase query.

func NewMatchPhraseQuery Uses

func NewMatchPhraseQuery(phrase string) *MatchPhraseQuery

NewMatchPhraseQuery creates a new MatchPhraseQuery

func (*MatchPhraseQuery) Analyzer Uses

func (q *MatchPhraseQuery) Analyzer(analyzer string) *MatchPhraseQuery

Analyzer specifies the analyzer to use for this query.

func (*MatchPhraseQuery) Boost Uses

func (q *MatchPhraseQuery) Boost(boost float32) *MatchPhraseQuery

Boost specifies the boost for this query.

func (*MatchPhraseQuery) Field Uses

func (q *MatchPhraseQuery) Field(field string) *MatchPhraseQuery

Field specifies the field for this query.

func (MatchPhraseQuery) MarshalJSON Uses

func (q MatchPhraseQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type MatchQuery Uses

type MatchQuery struct {
    // contains filtered or unexported fields
}

MatchQuery represents a FTS match query.

func NewMatchQuery Uses

func NewMatchQuery(match string) *MatchQuery

NewMatchQuery creates a new MatchQuery.

func (*MatchQuery) Analyzer Uses

func (q *MatchQuery) Analyzer(analyzer string) *MatchQuery

Analyzer specifies the analyzer to use for this query.

func (*MatchQuery) Boost Uses

func (q *MatchQuery) Boost(boost float32) *MatchQuery

Boost specifies the boost for this query.

func (*MatchQuery) Field Uses

func (q *MatchQuery) Field(field string) *MatchQuery

Field specifies the field for this query.

func (*MatchQuery) Fuzziness Uses

func (q *MatchQuery) Fuzziness(fuzziness int) *MatchQuery

Fuzziness specifies the fuziness for this query.

func (MatchQuery) MarshalJSON Uses

func (q MatchQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

func (*MatchQuery) PrefixLength Uses

func (q *MatchQuery) PrefixLength(length int) *MatchQuery

PrefixLength specifies the prefix length from this query.

type MutateInOptions Uses

type MutateInOptions struct {
    Timeout         time.Duration
    Context         context.Context
    Expiry          uint32
    Cas             Cas
    PersistTo       uint
    ReplicateTo     uint
    DurabilityLevel DurabilityLevel
    StoreSemantic   StoreSemantics
    Serializer      JSONSerializer
    RetryStrategy   RetryStrategy
    // Internal: This should never be used and is not supported.
    AccessDeleted bool
}

MutateInOptions are the set of options available to MutateIn.

type MutateInResult Uses

type MutateInResult struct {
    MutationResult
    // contains filtered or unexported fields
}

MutateInResult is the return type of any mutate in related operations. It contains Cas, mutation tokens and any returned content.

func (MutateInResult) ContentAt Uses

func (mir MutateInResult) ContentAt(idx int, valuePtr interface{}) error

ContentAt retrieves the value of the operation by its index. The index is the position of the operation as it was added to the builder.

type MutateInSpec Uses

type MutateInSpec struct {
    // contains filtered or unexported fields
}

MutateInSpec is the representation of an operation available when calling MutateIn

func ArrayAddUniqueSpec Uses

func ArrayAddUniqueSpec(path string, val interface{}, opts *ArrayAddUniqueSpecOptions) MutateInSpec

ArrayAddUniqueSpec adds an dictionary add unique operation to this mutation operation set.

func ArrayAppendSpec Uses

func ArrayAppendSpec(path string, val interface{}, opts *ArrayAppendSpecOptions) MutateInSpec

ArrayAppendSpec adds an element(s) to the end (i.e. right) of an array

func ArrayInsertSpec Uses

func ArrayInsertSpec(path string, val interface{}, opts *ArrayInsertSpecOptions) MutateInSpec

ArrayInsertSpec inserts an element at a given position within an array. The position should be specified as part of the path, e.g. path.to.array[3]

func ArrayPrependSpec Uses

func ArrayPrependSpec(path string, val interface{}, opts *ArrayPrependSpecOptions) MutateInSpec

ArrayPrependSpec adds an element to the beginning (i.e. left) of an array

func DecrementSpec Uses

func DecrementSpec(path string, delta int64, opts *CounterSpecOptions) MutateInSpec

DecrementSpec adds a decrement operation to this mutation operation set.

func IncrementSpec Uses

func IncrementSpec(path string, delta int64, opts *CounterSpecOptions) MutateInSpec

IncrementSpec adds an increment operation to this mutation operation set.

func InsertSpec Uses

func InsertSpec(path string, val interface{}, opts *InsertSpecOptions) MutateInSpec

InsertSpec inserts a value at the specified path within the document.

func RemoveSpec Uses

func RemoveSpec(path string, opts *RemoveSpecOptions) MutateInSpec

RemoveSpec removes the field at path.

func ReplaceSpec Uses

func ReplaceSpec(path string, val interface{}, opts *ReplaceSpecOptions) MutateInSpec

ReplaceSpec replaces the value of the field at path.

func UpsertSpec Uses

func UpsertSpec(path string, val interface{}, opts *UpsertSpecOptions) MutateInSpec

UpsertSpec creates a new value at the specified path within the document if it does not exist, if it does exist then it updates it.

type MutationMacro Uses

type MutationMacro string

MutationMacro can be supplied to MutateIn operations to perform ExpandMacros operations.

type MutationResult Uses

type MutationResult struct {
    Result
    // contains filtered or unexported fields
}

MutationResult is the return type of any store related operations. It contains Cas and mutation tokens.

func (MutationResult) MutationToken Uses

func (mr MutationResult) MutationToken() *MutationToken

MutationToken returns the mutation token belonging to an operation.

type MutationState Uses

type MutationState struct {
    // contains filtered or unexported fields
}

MutationState holds and aggregates MutationToken's across multiple operations.

func NewMutationState Uses

func NewMutationState(tokens ...MutationToken) *MutationState

NewMutationState creates a new MutationState for tracking mutation state.

func (*MutationState) Add Uses

func (mt *MutationState) Add(tokens ...MutationToken)

Add includes an operation's mutation information in this mutation state.

func (*MutationState) MarshalJSON Uses

func (mt *MutationState) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this mutation state to JSON.

func (*MutationState) UnmarshalJSON Uses

func (mt *MutationState) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshal's a mutation state from JSON.

type MutationToken Uses

type MutationToken struct {
    // contains filtered or unexported fields
}

MutationToken holds the mutation state information from an operation.

func (MutationToken) BucketName Uses

func (mt MutationToken) BucketName() string

BucketName returns the name of the bucket that this token belongs to.

func (MutationToken) PartitionID Uses

func (mt MutationToken) PartitionID() uint64

PartitionID returns the ID of the vbucket that this token belongs to.

func (MutationToken) PartitionUUID Uses

func (mt MutationToken) PartitionUUID() uint64

PartitionUUID returns the UUID of the vbucket that this token belongs to.

func (MutationToken) SequenceNumber Uses

func (mt MutationToken) SequenceNumber() uint64

SequenceNumber returns the sequence number of the vbucket that this token belongs to.

type NoResultsError Uses

type NoResultsError interface {
    error
    NoResultsError() bool
}

NoResultsError occurs when when no results are available to a query.

type NoRetryRetryAction Uses

type NoRetryRetryAction struct {
}

NoRetryRetryAction represents an action that indicates to not retry.

func (*NoRetryRetryAction) Duration Uses

func (ra *NoRetryRetryAction) Duration() time.Duration

Duration is the length of time to wait before retrying an operation.

type NumericFacet Uses

type NumericFacet struct {
    // contains filtered or unexported fields
}

NumericFacet is an FTS numeric range facet.

func NewNumericFacet Uses

func NewNumericFacet(field string, size int) *NumericFacet

NewNumericFacet creates a new numeric range facet.

func (*NumericFacet) AddRange Uses

func (f *NumericFacet) AddRange(name string, start, end float64) *NumericFacet

AddRange adds a new range to this numeric range facet.

func (NumericFacet) MarshalJSON Uses

func (f NumericFacet) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this facet to JSON for the FTS REST API.

type NumericFacetResult Uses

type NumericFacetResult struct {
    Name  string  `json:"name,omitempty"`
    Min   float64 `json:"min,omitempty"`
    Max   float64 `json:"max,omitempty"`
    Count int     `json:"count,omitempty"`
}

NumericFacetResult holds the results of a numeric facet in search results.

type NumericRangeQuery Uses

type NumericRangeQuery struct {
    // contains filtered or unexported fields
}

NumericRangeQuery represents a FTS numeric range query.

func NewNumericRangeQuery Uses

func NewNumericRangeQuery() *NumericRangeQuery

NewNumericRangeQuery creates a new NumericRangeQuery.

func (*NumericRangeQuery) Boost Uses

func (q *NumericRangeQuery) Boost(boost float32) *NumericRangeQuery

Boost specifies the boost for this query.

func (*NumericRangeQuery) Field Uses

func (q *NumericRangeQuery) Field(field string) *NumericRangeQuery

Field specifies the field for this query.

func (NumericRangeQuery) MarshalJSON Uses

func (q NumericRangeQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

func (*NumericRangeQuery) Max Uses

func (q *NumericRangeQuery) Max(max float32, inclusive bool) *NumericRangeQuery

Max specifies the maximum value and inclusiveness for this range query.

func (*NumericRangeQuery) Min Uses

func (q *NumericRangeQuery) Min(min float32, inclusive bool) *NumericRangeQuery

Min specifies the minimum value and inclusiveness for this range query.

type Origin Uses

type Origin struct {
    Type string `json:"type"`
    Name string `json:"name"`
}

Origin indicates why a user has a specific role. Is the Origin Type is "user" then the role is assigned directly to the user. If the type is "group" then it means that the role has been inherited from the group identified by the Name field.

type PasswordAuthenticator Uses

type PasswordAuthenticator struct {
    Username string
    Password string
}

PasswordAuthenticator implements an Authenticator which uses an RBAC username and password.

func (PasswordAuthenticator) Credentials Uses

func (ra PasswordAuthenticator) Credentials(req AuthCredsRequest) ([]UserPassPair, error)

Credentials returns the credentials for a particular service.

type PauseIngestSearchIndexOptions Uses

type PauseIngestSearchIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

PauseIngestSearchIndexOptions is the set of options available to the search index PauseIngest operation.

type PhraseQuery Uses

type PhraseQuery struct {
    // contains filtered or unexported fields
}

PhraseQuery represents a FTS phrase query.

func NewPhraseQuery Uses

func NewPhraseQuery(terms ...string) *PhraseQuery

NewPhraseQuery creates a new PhraseQuery.

func (*PhraseQuery) Boost Uses

func (q *PhraseQuery) Boost(boost float32) *PhraseQuery

Boost specifies the boost for this query.

func (*PhraseQuery) Field Uses

func (q *PhraseQuery) Field(field string) *PhraseQuery

Field specifies the field for this query.

func (PhraseQuery) MarshalJSON Uses

func (q PhraseQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type PingOptions Uses

type PingOptions struct {
    ServiceTypes []ServiceType
    ReportID     string
}

PingOptions are the options available to the Ping operation.

type PingResult Uses

type PingResult struct {
    Services  map[ServiceType][]PingServiceEntry
    ConfigRev int64
    ID        string
}

PingResult encapsulates the details from a executed ping operation.

func (*PingResult) MarshalJSON Uses

func (report *PingResult) MarshalJSON() ([]byte, error)

MarshalJSON generates a JSON representation of this ping report.

type PingServiceEntry Uses

type PingServiceEntry struct {
    RemoteAddr string
    State      string
    Latency    time.Duration
    Scope      string
    ID         string
    Detail     string
}

PingServiceEntry represents a single entry in a ping report.

type PrefixQuery Uses

type PrefixQuery struct {
    // contains filtered or unexported fields
}

PrefixQuery represents a FTS prefix query.

func NewPrefixQuery Uses

func NewPrefixQuery(prefix string) *PrefixQuery

NewPrefixQuery creates a new PrefixQuery.

func (*PrefixQuery) Boost Uses

func (q *PrefixQuery) Boost(boost float32) *PrefixQuery

Boost specifies the boost for this query.

func (*PrefixQuery) Field Uses

func (q *PrefixQuery) Field(field string) *PrefixQuery

Field specifies the field for this query.

func (PrefixQuery) MarshalJSON Uses

func (q PrefixQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type PrependOp Uses

type PrependOp struct {
    ID     string
    Value  string
    Result *MutationResult
    Err    error
    // contains filtered or unexported fields
}

PrependOp represents a type of `BulkOp` used for Prepend operations. See BulkOp.

type PrependOptions Uses

type PrependOptions struct {
    Timeout         time.Duration
    Context         context.Context
    DurabilityLevel DurabilityLevel
    PersistTo       uint
    ReplicateTo     uint
    Cas             Cas
    RetryStrategy   RetryStrategy
}

PrependOptions are the options available to the Prepend operation.

type ProjectionErrors Uses

type ProjectionErrors interface {
    error
    Errors() []KeyValueError
    ProjectionErrors() bool
}

ProjectionErrors is a collection of one or more KeyValueError that occurs during a Get with projections operation.

type PublishDesignDocumentOptions Uses

type PublishDesignDocumentOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

PublishDesignDocumentOptions is the set of options available to the ViewIndexManager PublishDesignDocument operation.

type QueryError Uses

type QueryError interface {
    error
    Code() uint32
    Message() string
    HTTPStatus() int
    Endpoint() string
    ContextID() string
}

QueryError occurs for errors created by Couchbase Server during N1ql query execution.

type QueryIndex Uses

type QueryIndex struct {
    Name      string    `json:"name"`
    IsPrimary bool      `json:"is_primary"`
    Type      IndexType `json:"using"`
    State     string    `json:"state"`
    Keyspace  string    `json:"keyspace_id"`
    Namespace string    `json:"namespace_id"`
    IndexKey  []string  `json:"index_key"`
}

QueryIndex represents a Couchbase GSI index.

type QueryIndexManager Uses

type QueryIndexManager struct {
    // contains filtered or unexported fields
}

QueryIndexManager provides methods for performing Couchbase N1ql index management. Volatile: This API is subject to change at any time.

func (*QueryIndexManager) BuildDeferredIndexes Uses

func (qm *QueryIndexManager) BuildDeferredIndexes(bucketName string, opts *BuildDeferredQueryIndexOptions) ([]string, error)

BuildDeferredIndexes builds all indexes which are currently in deferred state.

func (*QueryIndexManager) CreateIndex Uses

func (qm *QueryIndexManager) CreateIndex(bucketName, indexName string, fields []string, opts *CreateQueryIndexOptions) error

CreateIndex creates an index over the specified fields.

func (*QueryIndexManager) CreatePrimaryIndex Uses

func (qm *QueryIndexManager) CreatePrimaryIndex(bucketName string, opts *CreatePrimaryQueryIndexOptions) error

CreatePrimaryIndex creates a primary index. An empty customName uses the default naming.

func (*QueryIndexManager) DropIndex Uses

func (qm *QueryIndexManager) DropIndex(bucketName, indexName string, opts *DropQueryIndexOptions) error

DropIndex drops a specific index by name.

func (*QueryIndexManager) DropPrimaryIndex Uses

func (qm *QueryIndexManager) DropPrimaryIndex(bucketName string, opts *DropPrimaryQueryIndexOptions) error

DropPrimaryIndex drops the primary index. Pass an empty customName for unnamed primary indexes.

func (*QueryIndexManager) GetAllIndexes Uses

func (qm *QueryIndexManager) GetAllIndexes(bucketName string, opts *GetAllQueryIndexesOptions) ([]QueryIndex, error)

GetAllIndexes returns a list of all currently registered indexes.

func (*QueryIndexManager) WatchIndexes Uses

func (qm *QueryIndexManager) WatchIndexes(bucketName string, watchList []string, timeout WatchQueryIndexTimeout, opts *WatchQueryIndexOptions) error

WatchIndexes waits for a set of indexes to come online.

type QueryIndexesError Uses

type QueryIndexesError interface {
    error
    HTTPStatus() int
    QueryIndexNotFoundError() bool
    QueryIndexExistsError() bool
    BucketNotFoundError() bool
}

QueryIndexesError occurs for errors created By Couchbase Server when performing query index management.

type QueryMetadata Uses

type QueryMetadata struct {
    // contains filtered or unexported fields
}

QueryMetadata provides access to the metadata properties of a N1QL query result.

func (*QueryMetadata) ClientContextID Uses

func (r *QueryMetadata) ClientContextID() string

ClientContextID returns the context ID used for this query.

func (*QueryMetadata) Metrics Uses

func (r *QueryMetadata) Metrics() *QueryMetrics

Metrics returns metrics about execution of this result.

func (*QueryMetadata) Profile Uses

func (r *QueryMetadata) Profile() interface{}

Profile returns the profile generated for this query.

func (*QueryMetadata) RequestID Uses

func (r *QueryMetadata) RequestID() string

RequestID returns the request ID used for this query.

func (*QueryMetadata) Signature Uses

func (r *QueryMetadata) Signature() interface{}

Signature returns the schema of the results.

func (*QueryMetadata) Warnings Uses

func (r *QueryMetadata) Warnings() []QueryWarning

Warnings returns any warnings that were generated during execution of the query.

type QueryMetrics Uses

type QueryMetrics struct {
    ElapsedTime   time.Duration
    ExecutionTime time.Duration
    ResultCount   uint
    ResultSize    uint
    MutationCount uint
    SortCount     uint
    ErrorCount    uint
    WarningCount  uint
}

QueryMetrics encapsulates various metrics gathered during a queries execution.

type QueryOptions Uses

type QueryOptions struct {
    ScanConsistency QueryScanConsistency
    ConsistentWith  *MutationState
    AdHoc           bool
    Profile         QueryProfileType
    // ScanCap specifies the maximum buffered channel size between the indexer
    // client and the query service for index scans. This parameter controls
    // when to use scan backfill. Use a negative number to disable.
    ScanCap int
    // PipelineBatch controls the number of items execution operators can
    // batch for fetch from the KV node.
    PipelineBatch int
    // PipelineCap controls the maximum number of items each execution operator
    // can buffer between various operators.
    PipelineCap int
    // ScanWait specifies the maximum time wait for a scan.
    ScanWait time.Duration
    // ReadOnly controls whether a query can change a resulting recordset.  If
    // readonly is true, then only SELECT statements are permitted.
    ReadOnly bool
    // MaxParallelism controls the number of logical cores to use in parallel for this query.
    MaxParallelism  int
    ClientContextID string
    // Timeout and context are used to control cancellation of the data stream. Any timeout or deadline will also be
    // propagated to the server.
    Timeout              time.Duration
    Context              context.Context
    PositionalParameters []interface{}
    NamedParameters      map[string]interface{}
    // Metrics specifies whether or not to fetch metrics when executing the query.
    Metrics bool
    // Raw allows specifying custom query options.
    Raw map[string]interface{}

    // JSONSerializer is used to deserialize each row in the result. This should be a JSON deserializer as results are JSON.
    // NOTE: if not set then query will always default to DefaultJSONSerializer.
    Serializer    JSONSerializer
    RetryStrategy RetryStrategy
}

QueryOptions represents the options available when executing a N1QL query.

type QueryProfileType Uses

type QueryProfileType string

QueryProfileType specifies the profiling mode to use during a query.

type QueryResult Uses

type QueryResult struct {
    // contains filtered or unexported fields
}

QueryResult allows access to the results of a N1QL query.

func (*QueryResult) Close Uses

func (r *QueryResult) Close() error

Close marks the results as closed, returning any errors that occurred during reading the results.

func (*QueryResult) Metadata Uses

func (r *QueryResult) Metadata() (*QueryMetadata, error)

Metadata returns metadata for this result.

func (*QueryResult) Next Uses

func (r *QueryResult) Next(valuePtr interface{}) bool

Next assigns the next result from the results into the value pointer, returning whether the read was successful.

func (*QueryResult) NextBytes Uses

func (r *QueryResult) NextBytes() []byte

NextBytes returns the next result from the results as a byte array.

func (*QueryResult) One Uses

func (r *QueryResult) One(valuePtr interface{}) error

One assigns the first value from the results into the value pointer. It will close the results but not before iterating through all remaining results, as such this should only be used for very small resultsets - ideally of, at most, length 1.

type QueryScanConsistency Uses

type QueryScanConsistency int

QueryScanConsistency indicates the level of data consistency desired for a query.

type QueryStringQuery Uses

type QueryStringQuery struct {
    // contains filtered or unexported fields
}

QueryStringQuery represents a FTS string query.

func NewQueryStringQuery Uses

func NewQueryStringQuery(query string) *QueryStringQuery

NewQueryStringQuery creates a new StringQuery.

func (*QueryStringQuery) Boost Uses

func (q *QueryStringQuery) Boost(boost float32) *QueryStringQuery

Boost specifies the boost for this query.

func (QueryStringQuery) MarshalJSON Uses

func (q QueryStringQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type QueryWarning Uses

type QueryWarning struct {
    Code    uint32 `json:"code"`
    Message string `json:"msg"`
}

QueryWarning is the representation of any warnings that occurred during query execution.

type RawBinaryTranscoder Uses

type RawBinaryTranscoder struct {
}

RawBinaryTranscoder implements passthrough behavior of raw binary data. This transcoder does not apply any serialization.

This will apply the following behavior to the value: binary ([]byte) -> binary bytes, binary expectedFlags. default -> error.

func NewRawBinaryTranscoder Uses

func NewRawBinaryTranscoder() *RawBinaryTranscoder

NewRawBinaryTranscoder returns a new RawBinaryTranscoder.

func (*RawBinaryTranscoder) Decode Uses

func (t *RawBinaryTranscoder) Decode(bytes []byte, flags uint32, out interface{}) error

Decode applies raw binary transcoding behaviour to decode into a Go type.

func (*RawBinaryTranscoder) Encode Uses

func (t *RawBinaryTranscoder) Encode(value interface{}) ([]byte, uint32, error)

Encode applies raw binary transcoding behaviour to encode a Go type.

type RawJSONTranscoder Uses

type RawJSONTranscoder struct {
}

RawJSONTranscoder implements passthrough behavior of JSON data. This transcoder does not apply any serialization. It will forward data across the network without incurring unnecessary parsing costs.

This will apply the following behavior to the value: binary ([]byte) -> JSON bytes, JSON expectedFlags. string -> JSON bytes, JSON expectedFlags. default -> error.

func NewRawJSONTranscoder Uses

func NewRawJSONTranscoder() *RawJSONTranscoder

NewRawJSONTranscoder returns a new RawJSONTranscoder.

func (*RawJSONTranscoder) Decode Uses

func (t *RawJSONTranscoder) Decode(bytes []byte, flags uint32, out interface{}) error

Decode applies raw JSON transcoding behaviour to decode into a Go type.

func (*RawJSONTranscoder) Encode Uses

func (t *RawJSONTranscoder) Encode(value interface{}) ([]byte, uint32, error)

Encode applies raw JSON transcoding behaviour to encode a Go type.

type RawStringTranscoder Uses

type RawStringTranscoder struct {
}

RawStringTranscoder implements passthrough behavior of raw string data. This transcoder does not apply any serialization.

This will apply the following behavior to the value: string -> string bytes, string expectedFlags. default -> error.

func NewRawStringTranscoder Uses

func NewRawStringTranscoder() *RawStringTranscoder

NewRawStringTranscoder returns a new RawStringTranscoder.

func (*RawStringTranscoder) Decode Uses

func (t *RawStringTranscoder) Decode(bytes []byte, flags uint32, out interface{}) error

Decode applies raw string transcoding behaviour to decode into a Go type.

func (*RawStringTranscoder) Encode Uses

func (t *RawStringTranscoder) Encode(value interface{}) ([]byte, uint32, error)

Encode applies raw string transcoding behaviour to encode a Go type.

type RegexpQuery Uses

type RegexpQuery struct {
    // contains filtered or unexported fields
}

RegexpQuery represents a FTS regular expression query.

func NewRegexpQuery Uses

func NewRegexpQuery(regexp string) *RegexpQuery

NewRegexpQuery creates a new RegexpQuery.

func (*RegexpQuery) Boost Uses

func (q *RegexpQuery) Boost(boost float32) *RegexpQuery

Boost specifies the boost for this query.

func (*RegexpQuery) Field Uses

func (q *RegexpQuery) Field(field string) *RegexpQuery

Field specifies the field for this query.

func (RegexpQuery) MarshalJSON Uses

func (q RegexpQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type RemoveOp Uses

type RemoveOp struct {
    ID     string
    Cas    Cas
    Result *MutationResult
    Err    error
    // contains filtered or unexported fields
}

RemoveOp represents a type of `BulkOp` used for Remove operations. See BulkOp.

type RemoveOptions Uses

type RemoveOptions struct {
    Timeout         time.Duration
    Context         context.Context
    Cas             Cas
    PersistTo       uint
    ReplicateTo     uint
    DurabilityLevel DurabilityLevel
    RetryStrategy   RetryStrategy
}

RemoveOptions are the options available to the Remove command.

type RemoveSpecOptions Uses

type RemoveSpecOptions struct {
    IsXattr bool
}

RemoveSpecOptions are the options available to subdocument Remove operations.

type ReplaceOp Uses

type ReplaceOp struct {
    ID     string
    Value  interface{}
    Expiry uint32
    Cas    Cas
    Result *MutationResult
    Err    error
    // contains filtered or unexported fields
}

ReplaceOp represents a type of `BulkOp` used for Replace operations. See BulkOp.

type ReplaceOptions Uses

type ReplaceOptions struct {
    Timeout         time.Duration
    Context         context.Context
    Expiry          uint32
    Cas             Cas
    PersistTo       uint
    ReplicateTo     uint
    DurabilityLevel DurabilityLevel
    Transcoder      Transcoder
    RetryStrategy   RetryStrategy
}

ReplaceOptions are the options available to a Replace operation.

type ReplaceSpecOptions Uses

type ReplaceSpecOptions struct {
    IsXattr bool
}

ReplaceSpecOptions are the options available to subdocument Replace operations.

type Result Uses

type Result struct {
    // contains filtered or unexported fields
}

Result is the base type for the return types of operations

func (*Result) Cas Uses

func (d *Result) Cas() Cas

Cas returns the cas of the result.

type ResumeIngestSearchIndexOptions Uses

type ResumeIngestSearchIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

ResumeIngestSearchIndexOptions is the set of options available to the search index ResumeIngest operation.

type RetryAction Uses

type RetryAction interface {
    Duration() time.Duration
}

RetryAction is used by a RetryStrategy to calculate the duration to wait before retrying an operation. Returning a value of 0 indicates to not retry.

type RetryReason Uses

type RetryReason interface {
    AllowsNonIdempotentRetry() bool
    AlwaysRetry() bool
    Description() string
}

RetryReason represents the reason for an operation possibly being retried.

type RetryRequest Uses

type RetryRequest interface {
    RetryAttempts() uint32
    Identifier() string
    Idempotent() bool
    RetryReasons() []RetryReason
}

RetryRequest is a request that can possibly be retried.

type RetryStrategy Uses

type RetryStrategy interface {
    RetryAfter(req RetryRequest, reason RetryReason) RetryAction
}

RetryStrategy is to determine if an operation should be retried, and if so how long to wait before retrying.

type Role Uses

type Role struct {
    Name   string `json:"role"`
    Bucket string `json:"bucket_name"`
}

Role represents a specific permission.

type RoleAndDescription Uses

type RoleAndDescription struct {
    Role        Role
    DisplayName string
    Description string
}

RoleAndDescription represents a role with its display name and description.

type RoleAndOrigins Uses

type RoleAndOrigins struct {
    Role    Role
    Origins []Origin
}

RoleAndOrigins associates a role with its origins.

type RowLocation Uses

type RowLocation struct {
    Position       int    `json:"position,omitempty"`
    Start          int    `json:"start,omitempty"`
    End            int    `json:"end,omitempty"`
    ArrayPositions []uint `json:"array_positions,omitempty"`
}

RowLocation holds the location of a hit in a list of search results.

type Scope Uses

type Scope struct {
    // contains filtered or unexported fields
}

Scope represents a single scope within a bucket.

func (*Scope) Collection Uses

func (s *Scope) Collection(collectionName string) *Collection

Collection returns an instance of a collection. Volatile: This API is subject to change at any time.

func (*Scope) Name Uses

func (s *Scope) Name() string

Name returns the name of the scope.

type ScopeExistsOptions Uses

type ScopeExistsOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

ScopeExistsOptions is the set of options available to the ScopeExists operation.

type ScopeSpec Uses

type ScopeSpec struct {
    Name        string
    Collections []CollectionSpec
}

ScopeSpec describes the specification of a scope.

type SearchError Uses

type SearchError interface {
    error
    Message() string
}

SearchError occurs for errors created by Couchbase Server during Search query execution.

type SearchErrors Uses

type SearchErrors interface {
    error
    Errors() []SearchError
    HTTPStatus() int
    Endpoint() string
    ContextID() string
}

SearchErrors is a collection of one or more SearchError that occurs for errors created by Couchbase Server during Search query execution.

type SearchHighlightOptions Uses

type SearchHighlightOptions struct {
    Style  SearchHighlightStyle
    Fields []string
}

SearchHighlightOptions are the options available for search highlighting.

type SearchHighlightStyle Uses

type SearchHighlightStyle string

SearchHighlightStyle indicates the type of highlighting to use for a search query.

type SearchIndex Uses

type SearchIndex struct {
    // UUID is required for updates. It provides a means of ensuring consistency, the UUID must match the UUID value
    // for the index on the server.
    UUID string `json:"uuid"`
    Name string `json:"name"`
    // SourceName is the name of the source of the data for the index e.g. bucket name.
    SourceName string `json:"sourceName,omitempty"`
    // Type is the type of index, e.g. fulltext-index or fulltext-alias.
    Type string `json:"type"`
    // IndexParams are index properties such as store type and mappings.
    Params map[string]interface{} `json:"params"`
    // SourceUUID is the UUID of the data source, this can be used to more tightly tie the index to a source.
    SourceUUID string `json:"sourceUUID,omitempty"`
    // SourceParams are extra parameters to be defined. These are usually things like advanced connection and tuning
    // parameters.
    SourceParams map[string]interface{} `json:"sourceParams,omitempty"`
    // SourceType is the type of the data source, e.g. couchbase or nil depending on the Type field.
    SourceType string `json:"sourceType"`
    // PlanParams are plan properties such as number of replicas and number of partitions.
    PlanParams map[string]interface{} `json:"planParams,omitempty"`
}

SearchIndex is used to define a search index.

type SearchIndexManager Uses

type SearchIndexManager struct {
    // contains filtered or unexported fields
}

SearchIndexManager provides methods for performing Couchbase FTS index management. Experimental: This API is subject to change at any time.

func (*SearchIndexManager) AllowQuerying Uses

func (sim *SearchIndexManager) AllowQuerying(indexName string, opts *AllowQueryingSearchIndexOptions) error

AllowQuerying allows querying against an index.

func (*SearchIndexManager) AnalyzeDocument Uses

func (sim *SearchIndexManager) AnalyzeDocument(indexName string, doc interface{}, opts *AnalyzeDocumentOptions) ([]interface{}, error)

AnalyzeDocument returns how a doc is analyzed against a specific index.

func (*SearchIndexManager) DisallowQuerying Uses

func (sim *SearchIndexManager) DisallowQuerying(indexName string, opts *AllowQueryingSearchIndexOptions) error

DisallowQuerying disallows querying against an index.

func (*SearchIndexManager) DropIndex Uses

func (sim *SearchIndexManager) DropIndex(indexName string, opts *DropSearchIndexOptions) error

DropIndex removes the search index with the specific name.

func (*SearchIndexManager) FreezePlan Uses

func (sim *SearchIndexManager) FreezePlan(indexName string, opts *AllowQueryingSearchIndexOptions) error

FreezePlan freezes the assignment of index partitions to nodes.

func (*SearchIndexManager) GetAllIndexes Uses

func (sim *SearchIndexManager) GetAllIndexes(opts *GetAllSearchIndexOptions) ([]SearchIndex, error)

GetAllIndexes retrieves all of the search indexes for the cluster.

func (*SearchIndexManager) GetIndex Uses

func (sim *SearchIndexManager) GetIndex(indexName string, opts *GetSearchIndexOptions) (*SearchIndex, error)

GetIndex retrieves a specific search index by name.

func (*SearchIndexManager) GetIndexedDocumentsCount Uses

func (sim *SearchIndexManager) GetIndexedDocumentsCount(indexName string, opts *GetIndexedDocumentsCountOptions) (int, error)

GetIndexedDocumentsCount retrieves the document count for a search index.

func (*SearchIndexManager) PauseIngest Uses

func (sim *SearchIndexManager) PauseIngest(indexName string, opts *PauseIngestSearchIndexOptions) error

PauseIngest pauses updates and maintenance for an index.

func (*SearchIndexManager) ResumeIngest Uses

func (sim *SearchIndexManager) ResumeIngest(indexName string, opts *ResumeIngestSearchIndexOptions) error

ResumeIngest resumes updates and maintenance for an index.

func (*SearchIndexManager) UnfreezePlan Uses

func (sim *SearchIndexManager) UnfreezePlan(indexName string, opts *AllowQueryingSearchIndexOptions) error

UnfreezePlan unfreezes the assignment of index partitions to nodes.

func (*SearchIndexManager) UpsertIndex Uses

func (sim *SearchIndexManager) UpsertIndex(indexDefinition SearchIndex, opts *UpsertSearchIndexOptions) error

UpsertIndex creates or updates a search index.

type SearchIndexesError Uses

type SearchIndexesError interface {
    error
    HTTPStatus() int
    SearchIndexNotFoundError() bool
}

SearchIndexesError occurs for errors created By Couchbase Server when performing search index management.

type SearchMetadata Uses

type SearchMetadata struct {
    // contains filtered or unexported fields
}

SearchMetadata provides access to the metadata properties of a search query result.

func (SearchMetadata) Metrics Uses

func (r SearchMetadata) Metrics() SearchMetrics

Metrics returns a SearchMetrics containing metrics about the result.

func (SearchMetadata) Status Uses

func (r SearchMetadata) Status() SearchStatus

Status returns a SearchStatus containing information about the result.

type SearchMetrics Uses

type SearchMetrics struct {
    // contains filtered or unexported fields
}

SearchMetrics contains metrics about the result.

func (SearchMetrics) MaxScore Uses

func (r SearchMetrics) MaxScore() float64

MaxScore returns the highest score of all documents for this query.

func (SearchMetrics) Took Uses

func (r SearchMetrics) Took() time.Duration

Took returns the time taken to execute the search.

func (SearchMetrics) TotalRows Uses

func (r SearchMetrics) TotalRows() int

TotalRows is the actual number of rows before the limit was applied.

type SearchOptions Uses

type SearchOptions struct {
    Limit     int
    Skip      int
    Explain   bool
    Highlight *SearchHighlightOptions
    Fields    []string
    Sort      []interface{}
    Facets    map[string]interface{}
    // Timeout and context are used to control cancellation of the data stream. Any timeout or deadline will also be
    // propagated to the server.
    Timeout         time.Duration
    Context         context.Context
    ScanConsistency SearchScanConsistency
    ConsistentWith  *MutationState

    // JSONSerializer is used to deserialize each row in the result. This should be a JSON deserializer as results are JSON.
    // NOTE: if not set then query will always default to DefaultJSONSerializer.
    Serializer    JSONSerializer
    RetryStrategy RetryStrategy
}

SearchOptions represents a pending search query.

type SearchQuery Uses

type SearchQuery interface {
}

SearchQuery represents a search query.

type SearchResult Uses

type SearchResult struct {
    // contains filtered or unexported fields
}

SearchResult allows access to the results of a search query.

func (*SearchResult) Close Uses

func (r *SearchResult) Close() error

Close marks the results as closed, returning any errors that occurred during reading the results.

func (SearchResult) Facets Uses

func (r SearchResult) Facets() (map[string]FacetResult, error)

Facets contains the information relative to the facets requested in the search query.

func (*SearchResult) Metadata Uses

func (r *SearchResult) Metadata() (*SearchMetadata, error)

Metadata returns metadata for this result.

func (*SearchResult) Next Uses

func (r *SearchResult) Next(rowPtr *SearchRow) bool

Next assigns the next result from the results into the value pointer, returning whether the read was successful.

func (*SearchResult) NextBytes Uses

func (r *SearchResult) NextBytes() []byte

NextBytes returns the next result from the results as a byte array.

func (*SearchResult) One Uses

func (r *SearchResult) One(rowPtr *SearchRow) error

One assigns the first value from the results into the value pointer. It will close the results but not before iterating through all remaining results, as such this should only be used for very small resultsets - ideally

type SearchRow Uses

type SearchRow struct {
    Index       string                              `json:"index,omitempty"`
    ID          string                              `json:"id,omitempty"`
    Score       float64                             `json:"score,omitempty"`
    Explanation map[string]interface{}              `json:"explanation,omitempty"`
    Locations   map[string]map[string][]RowLocation `json:"locations,omitempty"`
    Fragments   map[string][]string                 `json:"fragments,omitempty"`
    // contains filtered or unexported fields
}

SearchRow holds a single hit in a list of search results.

func (*SearchRow) Fields Uses

func (row *SearchRow) Fields(valuePtr interface{}) error

Fields are any fields that were requested as a part of the search query.

type SearchScanConsistency Uses

type SearchScanConsistency int

SearchScanConsistency indicates the level of data consistency desired for a search query.

type SearchSortField Uses

type SearchSortField struct {
    // contains filtered or unexported fields
}

SearchSortField represents a FTS field sort.

func NewSearchSortField Uses

func NewSearchSortField(field string) *SearchSortField

NewSearchSortField creates a new SearchSortField.

func (*SearchSortField) Descending Uses

func (q *SearchSortField) Descending(descending bool) *SearchSortField

Descending specifies the ordering of the results.

func (SearchSortField) MarshalJSON Uses

func (q SearchSortField) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

func (*SearchSortField) Missing Uses

func (q *SearchSortField) Missing(missing string) *SearchSortField

Missing allows you to specify the FTS field sort missing behaviour.

func (*SearchSortField) Mode Uses

func (q *SearchSortField) Mode(mode string) *SearchSortField

Mode allows you to specify the FTS field sort mode.

func (*SearchSortField) Type Uses

func (q *SearchSortField) Type(value string) *SearchSortField

Type allows you to specify the FTS field sort type.

type SearchSortGeoDistance Uses

type SearchSortGeoDistance struct {
    // contains filtered or unexported fields
}

SearchSortGeoDistance represents a FTS geo sort.

func NewSearchSortGeoDistance Uses

func NewSearchSortGeoDistance(field string, lon, lat float64) *SearchSortGeoDistance

NewSearchSortGeoDistance creates a new SearchSortGeoDistance.

func (*SearchSortGeoDistance) Descending Uses

func (q *SearchSortGeoDistance) Descending(descending bool) *SearchSortGeoDistance

Descending specifies the ordering of the results.

func (SearchSortGeoDistance) MarshalJSON Uses

func (q SearchSortGeoDistance) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

func (*SearchSortGeoDistance) Unit Uses

func (q *SearchSortGeoDistance) Unit(unit string) *SearchSortGeoDistance

Unit specifies the unit used for sorting

type SearchSortId Uses

type SearchSortId struct {
    // contains filtered or unexported fields
}

SearchSortId represents a FTS Document ID sort.

func NewSearchSortId Uses

func NewSearchSortId() *SearchSortId

NewSearchSortId creates a new SearchSortScore.

func (*SearchSortId) Descending Uses

func (q *SearchSortId) Descending(descending bool) *SearchSortId

Descending specifies the ordering of the results.

func (SearchSortId) MarshalJSON Uses

func (q SearchSortId) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type SearchSortScore Uses

type SearchSortScore struct {
    // contains filtered or unexported fields
}

SearchSortScore represents a FTS score sort.

func NewSearchSortScore Uses

func NewSearchSortScore() *SearchSortScore

NewSearchSortScore creates a new SearchSortScore.

func (*SearchSortScore) Descending Uses

func (q *SearchSortScore) Descending(descending bool) *SearchSortScore

Descending specifies the ordering of the results.

func (SearchSortScore) MarshalJSON Uses

func (q SearchSortScore) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type SearchStatus Uses

type SearchStatus struct {
    // contains filtered or unexported fields
}

SearchStatus contains information about the status of the result.

func (SearchStatus) ErrorCount Uses

func (r SearchStatus) ErrorCount() int

ErrorCount is the number of errors for the results.

func (SearchStatus) IsSuccess Uses

func (r SearchStatus) IsSuccess() bool

IsSuccess verifies whether or not the search request was successful.

func (SearchStatus) SuccessCount Uses

func (r SearchStatus) SuccessCount() int

SuccessCount is the number of successes for the results.

func (SearchStatus) TotalCount Uses

func (r SearchStatus) TotalCount() int

TotalCount is the total number of results returning, including errors.

type ServiceNotAvailableError Uses

type ServiceNotAvailableError interface {
    ServiceNotAvailableError() bool
}

ServiceNotAvailableError represents that the service used for an operation is not available.

type ServiceType Uses

type ServiceType gocbcore.ServiceType

ServiceType specifies a particular Couchbase service type.

type StoreSemantics Uses

type StoreSemantics uint8

StoreSemantics is used to define the document level action to take during a MutateIn operation.

type SubdocDocFlag Uses

type SubdocDocFlag gocbcore.SubdocDocFlag

SubdocDocFlag specifies document-level flags for a sub-document operation.

type SubdocFlag Uses

type SubdocFlag gocbcore.SubdocFlag

SubdocFlag provides special handling flags for sub-document operations

type TemporaryFailureError Uses

type TemporaryFailureError interface {
    TemporaryFailureError() bool
}

TemporaryFailureError represents an error that is temporary.

type TermFacet Uses

type TermFacet struct {
    // contains filtered or unexported fields
}

TermFacet is an FTS term facet.

func NewTermFacet Uses

func NewTermFacet(field string, size int) *TermFacet

NewTermFacet creates a new TermFacet

func (TermFacet) MarshalJSON Uses

func (f TermFacet) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this facet to JSON for the FTS REST API.

type TermFacetResult Uses

type TermFacetResult struct {
    Term  string `json:"term,omitempty"`
    Count int    `json:"count,omitempty"`
}

TermFacetResult holds the results of a term facet in search results.

type TermQuery Uses

type TermQuery struct {
    // contains filtered or unexported fields
}

TermQuery represents a FTS term query.

func NewTermQuery Uses

func NewTermQuery(term string) *TermQuery

NewTermQuery creates a new TermQuery.

func (*TermQuery) Boost Uses

func (q *TermQuery) Boost(boost float32) *TermQuery

Boost specifies the boost for this query.

func (*TermQuery) Field Uses

func (q *TermQuery) Field(field string) *TermQuery

Field specifies the field for this query.

func (*TermQuery) Fuzziness Uses

func (q *TermQuery) Fuzziness(fuzziness int) *TermQuery

Fuzziness specifies the fuziness for this query.

func (TermQuery) MarshalJSON Uses

func (q TermQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

func (*TermQuery) PrefixLength Uses

func (q *TermQuery) PrefixLength(length int) *TermQuery

PrefixLength specifies the prefix length from this query.

type TermRangeQuery Uses

type TermRangeQuery struct {
    // contains filtered or unexported fields
}

TermRangeQuery represents a FTS term range query.

func NewTermRangeQuery Uses

func NewTermRangeQuery(term string) *TermRangeQuery

NewTermRangeQuery creates a new TermRangeQuery.

func (*TermRangeQuery) Boost Uses

func (q *TermRangeQuery) Boost(boost float32) *TermRangeQuery

Boost specifies the boost for this query.

func (*TermRangeQuery) Field Uses

func (q *TermRangeQuery) Field(field string) *TermRangeQuery

Field specifies the field for this query.

func (TermRangeQuery) MarshalJSON Uses

func (q TermRangeQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

func (*TermRangeQuery) Max Uses

func (q *TermRangeQuery) Max(max string, inclusive bool) *TermRangeQuery

Max specifies the maximum value and inclusiveness for this range query.

func (*TermRangeQuery) Min Uses

func (q *TermRangeQuery) Min(min string, inclusive bool) *TermRangeQuery

Min specifies the minimum value and inclusiveness for this range query.

type ThresholdLoggingOptions Uses

type ThresholdLoggingOptions struct {
    ServerDurationDisabled bool
    Interval               time.Duration
    SampleSize             uint32
    KVThreshold            time.Duration
    ViewsThreshold         time.Duration
    QueryThreshold         time.Duration
    SearchThreshold        time.Duration
    AnalyticsThreshold     time.Duration
    ManagementThreshold    time.Duration
}

ThresholdLoggingOptions is the set of options available for configuring threshold logging.

type TimeoutError Uses

type TimeoutError interface {
    Timeout() bool
}

TimeoutError occurs when an operation times out.

type TimeoutErrorWithDetail Uses

type TimeoutErrorWithDetail interface {
    Timeout() bool
    OperationID() string
    RetryAttempts() uint32
    RetryReasons() []RetryReason
    LocalAddress() string
    RemoteAddress() string
    Elapsed() time.Duration
    Operation() string
}

TimeoutErrorWithDetail occurs when an operation times out. This error type contains extra details about why the operation timed out.

type TouchOp Uses

type TouchOp struct {
    ID     string
    Expiry uint32
    Result *MutationResult
    Err    error
    // contains filtered or unexported fields
}

TouchOp represents a type of `BulkOp` used for Touch operations. See BulkOp.

type TouchOptions Uses

type TouchOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

TouchOptions are the options available to the Touch operation.

type Transcoder Uses

type Transcoder interface {
    // Decodes retrieved bytes into a Go type.
    Decode([]byte, uint32, interface{}) error

    // Encodes a Go type into bytes for storage.
    Encode(interface{}) ([]byte, uint32, error)
}

Transcoder provides an interface for transforming Go values to and from raw bytes for storage and retreival from Couchbase data storage.

type UnfreezePlanSearchIndexOptions Uses

type UnfreezePlanSearchIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

UnfreezePlanSearchIndexOptions is the set of options available to the search index UnfreezePlan operation.

type UnlockOptions Uses

type UnlockOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

UnlockOptions are the options available to the GetAndLock operation.

type UpdateBucketOptions Uses

type UpdateBucketOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

UpdateBucketOptions is the set of options available to the bucket manager UpdateBucket operation.

type UpsertDesignDocumentOptions Uses

type UpsertDesignDocumentOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

UpsertDesignDocumentOptions is the set of options available to the ViewIndexManager UpsertDesignDocument operation.

type UpsertGroupOptions Uses

type UpsertGroupOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

UpsertGroupOptions is the set of options available to the group manager Upsert operation.

type UpsertOp Uses

type UpsertOp struct {
    ID     string
    Value  interface{}
    Expiry uint32
    Cas    Cas
    Result *MutationResult
    Err    error
    // contains filtered or unexported fields
}

UpsertOp represents a type of `BulkOp` used for Upsert operations. See BulkOp.

type UpsertOptions Uses

type UpsertOptions struct {
    Timeout time.Duration
    Context context.Context
    // The expiry length in seconds
    Expiry          uint32
    PersistTo       uint
    ReplicateTo     uint
    DurabilityLevel DurabilityLevel
    Transcoder      Transcoder
    RetryStrategy   RetryStrategy
}

UpsertOptions are options that can be applied to an Upsert operation.

type UpsertSearchIndexOptions Uses

type UpsertSearchIndexOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy
}

UpsertSearchIndexOptions is the set of options available to the search index manager UpsertIndex operation.

type UpsertSpecOptions Uses

type UpsertSpecOptions struct {
    CreatePath bool
    IsXattr    bool
}

UpsertSpecOptions are the options available to subdocument Upsert operations.

type UpsertUserOptions Uses

type UpsertUserOptions struct {
    Timeout       time.Duration
    Context       context.Context
    RetryStrategy RetryStrategy

    DomainName string
}

UpsertUserOptions is the set of options available to the user manager Upsert operation.

type User Uses

type User struct {
    Username    string
    DisplayName string
    // Roles are the roles assigned to the user that are of type "user".
    Roles    []Role
    Groups   []string
    Password string
}

User represents a user which was retrieved from the server.

type UserAndMetadata Uses

type UserAndMetadata struct {
    Domain AuthDomain
    User   User
    // EffectiveRoles are all of the user's roles, regardless of origin.
    EffectiveRoles []Role
    // EffectiveRolesAndOrigins is the same as EffectiveRoles but with origin information included.
    EffectiveRolesAndOrigins []RoleAndOrigins
    ExternalGroups           []string
    PasswordChanged          time.Time
}

UserAndMetadata represents a user and user metadata from the server.

type UserManager Uses

type UserManager struct {
    // contains filtered or unexported fields
}

UserManager provides methods for performing Couchbase user management. Volatile: This API is subject to change at any time.

func (*UserManager) DropGroup Uses

func (um *UserManager) DropGroup(groupName string, opts *DropGroupOptions) error

DropGroup removes a group from the server.

func (*UserManager) DropUser Uses

func (um *UserManager) DropUser(name string, opts *DropUserOptions) error

DropUser removes a built-in RBAC user on the cluster.

func (*UserManager) GetAllGroups Uses

func (um *UserManager) GetAllGroups(opts *GetAllGroupsOptions) ([]Group, error)

GetAllGroups fetches all groups from the server.

func (*UserManager) GetAllUsers Uses

func (um *UserManager) GetAllUsers(opts *GetAllUsersOptions) ([]UserAndMetadata, error)

GetAllUsers returns a list of all the users from the cluster.

func (*UserManager) GetGroup Uses

func (um *UserManager) GetGroup(groupName string, opts *GetGroupOptions) (*Group, error)

GetGroup fetches a single group from the server.

func (*UserManager) GetRoles Uses

func (um *UserManager) GetRoles(opts *GetRolesOptions) ([]RoleAndDescription, error)

GetRoles lists the roles supported by the cluster.

func (*UserManager) GetUser Uses

func (um *UserManager) GetUser(name string, opts *GetUserOptions) (*UserAndMetadata, error)

GetUser returns the data for a particular user

func (*UserManager) UpsertGroup Uses

func (um *UserManager) UpsertGroup(group Group, opts *UpsertGroupOptions) error

UpsertGroup creates, or updates, a group on the server.

func (*UserManager) UpsertUser Uses

func (um *UserManager) UpsertUser(user User, opts *UpsertUserOptions) error

UpsertUser updates a built-in RBAC user on the cluster.

type UserManagerError Uses

type UserManagerError interface {
    error
    HTTPStatus() int
    UserNotFoundError() bool
    GroupNotFoundError() bool
}

UserManagerError occurs for errors created By Couchbase Server when performing user management.

type UserPassPair Uses

type UserPassPair gocbcore.UserPassPair

UserPassPair represents a username and password pair.

type View Uses

type View struct {
    Map    string `json:"map,omitempty"`
    Reduce string `json:"reduce,omitempty"`
}

View represents a Couchbase view within a design document.

type ViewErrorMode Uses

type ViewErrorMode int

ViewErrorMode pecifies the behaviour of the query engine should an error occur during the gathering of view index results which would result in only partial results being available.

type ViewIndexManager Uses

type ViewIndexManager struct {
    // contains filtered or unexported fields
}

ViewIndexManager provides methods for performing View management. Volatile: This API is subject to change at any time.

func (*ViewIndexManager) DropDesignDocument Uses

func (vm *ViewIndexManager) DropDesignDocument(name string, namespace DesignDocumentNamespace, opts *DropDesignDocumentOptions) error

DropDesignDocument will remove a design document from the given bucket.

func (*ViewIndexManager) GetAllDesignDocuments Uses

func (vm *ViewIndexManager) GetAllDesignDocuments(namespace DesignDocumentNamespace, opts *GetAllDesignDocumentsOptions) ([]*DesignDocument, error)

GetAllDesignDocuments will retrieve all design documents for the given bucket.

func (*ViewIndexManager) GetDesignDocument Uses

func (vm *ViewIndexManager) GetDesignDocument(name string, namespace DesignDocumentNamespace, opts *GetDesignDocumentOptions) (*DesignDocument, error)

GetDesignDocument retrieves a single design document for the given bucket.

func (*ViewIndexManager) PublishDesignDocument Uses

func (vm *ViewIndexManager) PublishDesignDocument(name string, opts *PublishDesignDocumentOptions) error

PublishDesignDocument publishes a design document to the given bucket.

func (*ViewIndexManager) UpsertDesignDocument Uses

func (vm *ViewIndexManager) UpsertDesignDocument(ddoc DesignDocument, namespace DesignDocumentNamespace, opts *UpsertDesignDocumentOptions) error

UpsertDesignDocument will insert a design document to the given bucket, or update an existing design document with the same name.

type ViewIndexesError Uses

type ViewIndexesError interface {
    error
    HTTPStatus() int
    DesignDocumentNotFoundError() bool
    DesignDocumentExistsError() bool
    DesignDocumentPublishDropFailError() bool
}

ViewIndexesError occurs for errors created By Couchbase Server when performing index management.

type ViewMetadata Uses

type ViewMetadata struct {
    // contains filtered or unexported fields
}

ViewMetadata provides access to the metadata properties of a view query result.

func (*ViewMetadata) Debug Uses

func (r *ViewMetadata) Debug() interface{}

Debug returns the debug information associated with the query, if requested.

func (*ViewMetadata) TotalRows Uses

func (r *ViewMetadata) TotalRows() int

TotalRows returns the total number of rows in the view, can be greater than the number of rows returned.

type ViewOptions Uses

type ViewOptions struct {
    ScanConsistency ViewScanConsistency
    Skip            uint
    Limit           uint
    Order           ViewOrdering
    Reduce          bool
    Group           bool
    GroupLevel      uint
    Key             interface{}
    Keys            []interface{}
    StartKey        interface{}
    EndKey          interface{}
    InclusiveEnd    bool
    StartKeyDocID   string
    EndKeyDocID     string
    Namespace       DesignDocumentNamespace
    Raw             map[string]string
    // Timeout and context are used to control cancellation of the data stream.
    Context context.Context
    Timeout time.Duration
    OnError ViewErrorMode
    Debug   bool

    // JSONSerializer is used to deserialize each row in the result. This should be a JSON deserializer as results are JSON.
    // NOTE: if not set then views will always default to DefaultJSONSerializer.
    Serializer JSONSerializer

    RetryStrategy RetryStrategy
}

ViewOptions represents the options available when executing view query.

type ViewOrdering Uses

type ViewOrdering int

ViewOrdering specifies the ordering for the view queries results.

type ViewQueryError Uses

type ViewQueryError interface {
    error
    Reason() string
    Message() string
}

ViewQueryError is the error type for an error that occurs during view query execution.

type ViewQueryErrors Uses

type ViewQueryErrors interface {
    error
    Errors() []ViewQueryError
    HTTPStatus() int
    Endpoint() string
}

ViewQueryErrors is a collection of one or more ViewQueryError that occurs for errors created by Couchbase Server during View query execution.

type ViewResult Uses

type ViewResult struct {
    // contains filtered or unexported fields
}

ViewResult implements an iterator interface which can be used to iterate over the rows of the query results.

func (*ViewResult) Close Uses

func (r *ViewResult) Close() error

Close marks the results as closed, returning any errors that occurred during reading the results.

func (*ViewResult) Metadata Uses

func (r *ViewResult) Metadata() (*ViewMetadata, error)

Metadata returns metadata for this result.

func (*ViewResult) Next Uses

func (r *ViewResult) Next(rowPtr *ViewRow) bool

Next assigns the next result from the results into the value pointer, returning whether the read was successful.

func (*ViewResult) NextBytes Uses

func (r *ViewResult) NextBytes() []byte

NextBytes returns the next result from the results as a byte array.

func (*ViewResult) One Uses

func (r *ViewResult) One(rowPtr *ViewRow) error

One assigns the first value from the results into the value pointer. It will close the results but not before iterating through all remaining results, as such this should only be used for very small resultsets - ideally of, at most, length 1.

type ViewRow Uses

type ViewRow struct {
    ID string
    // contains filtered or unexported fields
}

ViewRow provides access to a single view query row.

func (*ViewRow) Key Uses

func (r *ViewRow) Key(keyPtr interface{}) error

Key assigns the current result key from the results into the value pointer, returning any error that occurred.

func (*ViewRow) Value Uses

func (r *ViewRow) Value(valuePtr interface{}) error

Value assigns the current result value from the results into the value pointer, returning any error that occurred.

type ViewScanConsistency Uses

type ViewScanConsistency int

ViewScanConsistency specifies the consistency required for a view query.

type WatchQueryIndexOptions Uses

type WatchQueryIndexOptions struct {
    WatchPrimary  bool
    RetryStrategy RetryStrategy
}

WatchQueryIndexOptions is the set of options available to the query indexes Watch operation.

type WatchQueryIndexTimeout Uses

type WatchQueryIndexTimeout struct {
    Timeout time.Duration
    Context context.Context
}

WatchQueryIndexTimeout is used for setting a timeout value for the query indexes WatchIndexes operation.

type WildcardQuery Uses

type WildcardQuery struct {
    // contains filtered or unexported fields
}

WildcardQuery represents a FTS wildcard query.

func NewWildcardQuery Uses

func NewWildcardQuery(wildcard string) *WildcardQuery

NewWildcardQuery creates a new WildcardQuery.

func (*WildcardQuery) Boost Uses

func (q *WildcardQuery) Boost(boost float32) *WildcardQuery

Boost specifies the boost for this query.

func (*WildcardQuery) Field Uses

func (q *WildcardQuery) Field(field string) *WildcardQuery

Field specifies the field for this query.

func (WildcardQuery) MarshalJSON Uses

func (q WildcardQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the FTS REST API.

type WithDurationRetryAction Uses

type WithDurationRetryAction struct {
    WithDuration time.Duration
}

WithDurationRetryAction represents an action that indicates to retry with a given duration.

func (*WithDurationRetryAction) Duration Uses

func (ra *WithDurationRetryAction) Duration() time.Duration

Duration is the length of time to wait before retrying an operation.

Package gocb imports 20 packages (graph) and is imported by 7 packages. Updated 2019-12-11. Refresh now. Tools for package owners.