gocb.v1: gopkg.in/couchbase/gocb.v1 Index | Files | Directories

package gocb

import "gopkg.in/couchbase/gocb.v1"

Index

Package Files

analyticsingest.go analyticsquery.go auth.go bucket.go bucket_analyticsquery.go bucket_crud.go bucket_diag.go bucket_ds.go bucket_dura.go bucket_internal.go bucket_multi.go bucket_n1qlquery.go bucket_ping.go bucket_searchquery.go bucket_subdoc.go bucket_token.go bucket_viewquery.go bucketmgr.go cluster.go cluster_analyticsquery.go cluster_n1qlquery.go cluster_searchquery.go clustermgr.go clustermgr_searchindex.go connspec.go constants.go error.go jsontime.go logging.go n1qlquery.go queryretry_behaviour.go searchquery.go spatialquery.go thresholdlogtracer.go token.go tracing.go transcoding.go util.go version.go viewquery.go

Constants

const (
    // DiagStateOk indicates that the connection state is ok.
    DiagStateOk = DiagConnState(0)

    // DiagStateDisconnected indicates that the connection is disconnected.
    DiagStateDisconnected = DiagConnState(1)
)
const (
    // Couchbase indicates a Couchbase bucket type.
    Couchbase = BucketType(0)

    // Memcached indicates a Memcached bucket type.
    Memcached = BucketType(1)

    // Ephemeral indicates an Ephemeral bucket type.
    Ephemeral = BucketType(2)
)
const (
    // SearchIndexSourceTypeCouchbase specifies to use a couchbase FTS index sourceType
    SearchIndexSourceTypeCouchbase = "couchbase"

    // SearchIndexSourceTypeMemcached specifies to use a memcached FTS index sourceType
    SearchIndexSourceTypeMemcached = "memcached"

    // SearchIndexIngestControlOpPause specifies to use FTS ingest control op of pause
    SearchIndexIngestControlOpPause = "pause"

    // SearchIndexIngestControlOpResume specifies to use FTS ingest control op of resume
    SearchIndexIngestControlOpResume = "resume"

    // SearchIndexQueryControlOpPause specifies to use FTS query control op of allow
    SearchIndexQueryControlOpPause = "allow"

    // SearchIndexQueryControlOpResume specifies to use FTS ingest control op of disallow
    SearchIndexQueryControlOpResume = "disallow"

    // SearchIndexPlanFreezeControlOpPause specifies to use FTS plan freeze control op of freeze
    SearchIndexPlanFreezeControlOpPause = "freeze"

    // SearchIndexPlanFreezeControlOpResume specifies to use FTS plan freeze control op of unfreeze
    SearchIndexPlanFreezeControlOpResume = "unfreeze"
)
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 (
    // 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)

    // SubdocDocFlagReplaceDoc indices that this operation should be a replace rather than upsert.
    SubdocDocFlagReplaceDoc = SubdocDocFlag(gocbcore.SubdocDocFlagReplaceDoc)

    // SubdocDocFlagAccessDeleted indicates that you wish to receive soft-deleted documents.
    SubdocDocFlagAccessDeleted = SubdocDocFlag(gocbcore.SubdocDocFlagAccessDeleted)
)
const (
    // MemdService represents a memcached service.
    MemdService = 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)

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

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

    // CbasService represents an analytics service.
    CbasService = ServiceType(gocbcore.CbasService)
)
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 (
    // NotBounded indicates no data consistency is required.
    NotBounded = ConsistencyMode(1)
    // RequestPlus indicates that request-level data consistency is required.
    RequestPlus = ConsistencyMode(2)
    // StatementPlus inidcates that statement-level data consistency is required.
    StatementPlus = ConsistencyMode(3)
)
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 (
    // Before indicates to update the index before querying it.
    Before = StaleMode(1)
    // None indicates that no special behaviour should be used.
    None = StaleMode(2)
    // After indicates to update the index asynchronously after querying.
    After = StaleMode(3)
)
const (
    // Ascending indicates the query results should be sorted from lowest to highest.
    Ascending = SortOrder(1)
    // Descending indicates the query results should be sorted from highest to lowest.
    Descending = SortOrder(2)
)

Variables

var (
    // ErrNotEnoughReplicas occurs when not enough replicas exist to match the specified durability requirements.
    ErrNotEnoughReplicas = errors.New("Not enough replicas to match durability requirements.")
    // ErrDurabilityTimeout occurs when the server took too long to meet the specified durability requirements.
    ErrDurabilityTimeout = errors.New("Failed to meet durability requirements in time.")
    // ErrNoResults occurs when no results are available to a query.
    ErrNoResults = errors.New("No results returned.")
    // ErrNoOpenBuckets occurs when a cluster-level operation is performed before any buckets are opened.
    ErrNoOpenBuckets = errors.New("You must open a bucket before you can perform cluster level operations.")
    // ErrIndexInvalidName occurs when an invalid name was specified for an index.
    ErrIndexInvalidName = errors.New("An invalid index name was specified.")
    // ErrIndexNoFields occurs when an index with no fields is created.
    ErrIndexNoFields = errors.New("You must specify at least one field to index.")
    // ErrIndexNotFound occurs when an operation expects an index but it was not found.
    ErrIndexNotFound = errors.New("The index specified does not exist.")
    // ErrIndexAlreadyExists occurs when an operation expects an index not to exist, but it was found.
    ErrIndexAlreadyExists = errors.New("The index specified already exists.")
    // ErrFacetNoRanges occurs when a range-based facet is specified but no ranges were indicated.
    ErrFacetNoRanges = errors.New("At least one range must be specified on a facet.")

    // ErrSearchIndexInvalidName occurs when an invalid name was specified for a search index.
    ErrSearchIndexInvalidName = errors.New("An invalid search index name was specified.")
    // ErrSearchIndexMissingType occurs when no type was specified for a search index.
    ErrSearchIndexMissingType = errors.New("No search index type was specified.")
    // ErrSearchIndexInvalidSourceType occurs when an invalid source type was specific for a search index.
    ErrSearchIndexInvalidSourceType = errors.New("An invalid search index source type was specified.")
    // ErrSearchIndexInvalidSourceName occurs when an invalid source name was specific for a search index.
    ErrSearchIndexInvalidSourceName = errors.New("An invalid search index source name was specified.")
    // ErrSearchIndexAlreadyExists occurs when an invalid source name was specific for a search index.
    ErrSearchIndexAlreadyExists = errors.New("The search index specified already exists.")
    // ErrSearchIndexInvalidIngestControlOp occurs when an invalid ingest control op was specific for a search index.
    ErrSearchIndexInvalidIngestControlOp = errors.New("An invalid search index ingest control op was specified.")
    // ErrSearchIndexInvalidQueryControlOp occurs when an invalid query control op was specific for a search index.
    ErrSearchIndexInvalidQueryControlOp = errors.New("An invalid search index query control op was specified.")
    // ErrSearchIndexInvalidPlanFreezeControlOp occurs when an invalid plan freeze control op was specific for a search index.
    ErrSearchIndexInvalidPlanFreezeControlOp = errors.New("An invalid search index plan freeze control op was specified.")

    // ErrMixedAuthentication occurs when a combination of certification authentication and password authentication are used.
    ErrMixedAuthentication = errors.New("Invalid mixed authentication configuration, cannot use cluster level authentication with bucket password authentication.")
    // ErrMixedCertAuthentication occurs when client certificate authentication is setup but CertAuthenticator is not used or vise versa.
    ErrMixedCertAuthentication = errors.New("Invalid mixed authentication configuration, client certificate and CertAuthenticator must be used together.")
    // ErrDispatchFail occurs when we failed to execute an operation due to internal routing issues.
    ErrDispatchFail = gocbcore.ErrDispatchFail
    // ErrBadHosts occurs when an invalid list of hosts is specified for bootstrapping.
    ErrBadHosts = gocbcore.ErrBadHosts
    // ErrProtocol occurs when an invalid protocol is specified for bootstrapping.
    ErrProtocol = gocbcore.ErrProtocol
    // ErrNoReplicas occurs when an operation expecting replicas is performed, but no replicas are available.
    ErrNoReplicas = gocbcore.ErrNoReplicas
    // ErrInvalidServer occurs when a specified server index is invalid.
    ErrInvalidServer = gocbcore.ErrInvalidServer
    // ErrInvalidVBucket occurs when a specified vbucket index is invalid.
    ErrInvalidVBucket = gocbcore.ErrInvalidVBucket
    // ErrInvalidReplica occurs when a specified replica index is invalid.
    ErrInvalidReplica = gocbcore.ErrInvalidReplica
    // ErrInvalidCert occurs when the specified certificate is not valid.
    ErrInvalidCert = gocbcore.ErrInvalidCert
    // ErrInvalidCredentials is returned when an invalid set of credentials is provided for a service.
    ErrInvalidCredentials = gocbcore.ErrInvalidCredentials
    // ErrNonZeroCas occurs when an operation that require a CAS value of 0 is used with a non-zero value.
    ErrNonZeroCas = gocbcore.ErrNonZeroCas

    // ErrShutdown occurs when an operation is performed on a bucket that has been closed.
    ErrShutdown = gocbcore.ErrShutdown
    // ErrOverload occurs when more operations were dispatched than the client is capable of writing.
    ErrOverload = gocbcore.ErrOverload
    // ErrNetwork occurs when various generic network errors occur.
    ErrNetwork = gocbcore.ErrNetwork
    // ErrTimeout occurs when an operation times out.
    ErrTimeout = gocbcore.ErrTimeout
    // ErrCliInternalError indicates an internal error occurred within the client.
    ErrCliInternalError = gocbcore.ErrCliInternalError

    // ErrStreamClosed occurs when an error is related to a stream closing.
    ErrStreamClosed = gocbcore.ErrStreamClosed
    // ErrStreamStateChanged occurs when an error is related to a cluster rebalance.
    ErrStreamStateChanged = gocbcore.ErrStreamStateChanged
    // ErrStreamDisconnected occurs when a stream is closed due to a connection dropping.
    ErrStreamDisconnected = gocbcore.ErrStreamDisconnected
    // ErrStreamTooSlow occurs when a stream is closed due to being too slow at consuming data.
    ErrStreamTooSlow = gocbcore.ErrStreamTooSlow

    // ErrKeyNotFound occurs when the key is not found on the server.
    ErrKeyNotFound = gocbcore.ErrKeyNotFound
    // ErrKeyExists occurs when the key already exists on the server.
    ErrKeyExists = gocbcore.ErrKeyExists
    // ErrTooBig occurs when the document is too big to be stored.
    ErrTooBig = gocbcore.ErrTooBig
    // ErrNotStored occurs when an item fails to be stored.  Usually an append/prepend to missing key.
    ErrNotStored = gocbcore.ErrNotStored
    // ErrAuthError occurs when there is an issue with authentication (bad password?).
    ErrAuthError = gocbcore.ErrAuthError
    // ErrRangeError occurs when an invalid range is specified.
    ErrRangeError = gocbcore.ErrRangeError
    // ErrRollback occurs when a server rollback has occurred making the operation no longer valid.
    ErrRollback = gocbcore.ErrRollback
    // ErrAccessError occurs when you do not have access to the specified resource.
    ErrAccessError = gocbcore.ErrAccessError
    // ErrOutOfMemory occurs when the server has run out of memory to process requests.
    ErrOutOfMemory = gocbcore.ErrOutOfMemory
    // ErrNotSupported occurs when an operation is performed which is not supported.
    ErrNotSupported = gocbcore.ErrNotSupported
    // ErrInternalError occurs when an internal error has prevented an operation from succeeding.
    ErrInternalError = gocbcore.ErrInternalError
    // ErrBusy occurs when the server is too busy to handle your operation.
    ErrBusy = gocbcore.ErrBusy
    // ErrTmpFail occurs when the server is not immediately able to handle your request.
    ErrTmpFail = gocbcore.ErrTmpFail

    // ErrSubDocPathNotFound occurs when a sub-document operation targets a path
    // which does not exist in the specifie document.
    ErrSubDocPathNotFound = gocbcore.ErrSubDocPathNotFound
    // ErrSubDocPathMismatch occurs when a sub-document operation specifies a path
    // which does not match the document structure (field access on an array).
    ErrSubDocPathMismatch = gocbcore.ErrSubDocPathMismatch
    // ErrSubDocPathInvalid occurs when a sub-document path could not be parsed.
    ErrSubDocPathInvalid = gocbcore.ErrSubDocPathInvalid
    // ErrSubDocPathTooBig occurs when a sub-document path is too big.
    ErrSubDocPathTooBig = gocbcore.ErrSubDocPathTooBig
    // ErrSubDocDocTooDeep occurs when an operation would cause a document to be
    // nested beyond the depth limits allowed by the sub-document specification.
    ErrSubDocDocTooDeep = gocbcore.ErrSubDocDocTooDeep
    // ErrSubDocCantInsert occurs when a sub-document operation could not insert.
    ErrSubDocCantInsert = gocbcore.ErrSubDocCantInsert
    // ErrSubDocNotJson occurs when a sub-document operation is performed on a
    // document which is not JSON.
    ErrSubDocNotJson = gocbcore.ErrSubDocNotJson
    // ErrSubDocBadRange occurs when a sub-document operation is performed with
    // a bad range.
    ErrSubDocBadRange = gocbcore.ErrSubDocBadRange
    // ErrSubDocBadDelta occurs when a sub-document counter operation is performed
    // and the specified delta is not valid.
    ErrSubDocBadDelta = gocbcore.ErrSubDocBadDelta
    // ErrSubDocPathExists occurs when a sub-document operation expects a path not
    // to exists, but the path was found in the document.
    ErrSubDocPathExists = gocbcore.ErrSubDocPathExists
    // ErrSubDocValueTooDeep occurs when a sub-document operation specifies a value
    // which is deeper than the depth limits of the sub-document specification.
    ErrSubDocValueTooDeep = gocbcore.ErrSubDocValueTooDeep
    // ErrSubDocBadCombo occurs when a multi-operation sub-document operation is
    // performed and operations within the package of ops conflict with each other.
    ErrSubDocBadCombo = gocbcore.ErrSubDocBadCombo
    // ErrSubDocBadMulti occurs when a multi-operation sub-document operation is
    // performed and operations within the package of ops conflict with each other.
    ErrSubDocBadMulti = gocbcore.ErrSubDocBadMulti
    // ErrSubDocSuccessDeleted occurs when a multi-operation sub-document operation
    // is performed on a soft-deleted document.
    ErrSubDocSuccessDeleted = gocbcore.ErrSubDocSuccessDeleted

    // ErrSubDocXattrInvalidFlagCombo occurs when an invalid set of
    // extended-attribute flags is passed to a sub-document operation.
    ErrSubDocXattrInvalidFlagCombo = gocbcore.ErrSubDocXattrInvalidFlagCombo
    // ErrSubDocXattrInvalidKeyCombo occurs when an invalid set of key operations
    // are specified for a extended-attribute sub-document operation.
    ErrSubDocXattrInvalidKeyCombo = gocbcore.ErrSubDocXattrInvalidKeyCombo
    // ErrSubDocXattrUnknownMacro occurs when an invalid macro value is specified.
    ErrSubDocXattrUnknownMacro = gocbcore.ErrSubDocXattrUnknownMacro
    // ErrSubDocXattrUnknownVAttr occurs when an invalid virtual attribute is specified.
    ErrSubDocXattrUnknownVAttr = gocbcore.ErrSubDocXattrUnknownVAttr
    // ErrSubDocXattrCannotModifyVAttr occurs when a mutation is attempted upon
    // a virtual attribute (which are immutable by definition).
    ErrSubDocXattrCannotModifyVAttr = gocbcore.ErrSubDocXattrCannotModifyVAttr
    // ErrSubDocMultiPathFailureDeleted occurs when a Multi Path Failure occurs on
    // a soft-deleted document.
    ErrSubDocMultiPathFailureDeleted = gocbcore.ErrSubDocMultiPathFailureDeleted
)

func ErrorCause Uses

func ErrorCause(err error) error

ErrorCause returns the underlying error for an enhanced error.

func IngestMethodInsert Uses

func IngestMethodInsert(bucket *Bucket, key string, val interface{}) error

IngestMethodInsert indicates that the Insert function should be used for kv ingest.

func IngestMethodReplace Uses

func IngestMethodReplace(bucket *Bucket, key string, val interface{}) error

IngestMethodReplace indicates that the Replace function should be used for kv ingest.

func IngestMethodUpsert Uses

func IngestMethodUpsert(bucket *Bucket, key string, val interface{}) error

IngestMethodUpsert indicates that the Upsert function should be used for kv ingest.

func IsKeyExistsError Uses

func IsKeyExistsError(err error) bool

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

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

func IsKeyNotFoundError Uses

func IsKeyNotFoundError(err error) bool

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

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

func IsStatusBusyError Uses

func IsStatusBusyError(err error) bool

IsStatusBusyError indicates whether the passed error is a key-value "server is busy, try again later" error.

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

func IsTmpFailError Uses

func IsTmpFailError(err error) bool

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

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

func PassthroughDataConverterFunction Uses

func PassthroughDataConverterFunction(docBytes []byte) (interface{}, error)

PassthroughDataConverterFunction is a DataConverterFunction that returns the data that is passed to it. The interface out of this represents a map[string]interface{}.

func QueryExponentialDelayFunction Uses

func QueryExponentialDelayFunction(retryDelay uint, retries uint) time.Duration

QueryExponentialDelayFunction provides retry delay durations (ms) following an exponential increment pattern

func QueryLinearDelayFunction Uses

func QueryLinearDelayFunction(retryDelay uint, retries uint) time.Duration

QueryLinearDelayFunction provides retry delay durations (ms) following a linear increment pattern

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 UUIDIdGeneratorFunction Uses

func UUIDIdGeneratorFunction(doc interface{}) (string, error)

UUIDIdGeneratorFunction is a IdGeneratorFunction that creates a UUID ID for each document.

func Version Uses

func Version() string

Version returns a string representation of the current SDK version.

type AnalyticsDeferredResultHandle Uses

type AnalyticsDeferredResultHandle interface {
    One(valuePtr interface{}) error
    Next(valuePtr interface{}) bool
    NextBytes() []byte
    Close() error

    Status() (string, error)
}

AnalyticsDeferredResultHandle allows access to the handle of a deferred Analytics query.

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

type AnalyticsIngestOptions Uses

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

AnalyticsIngestOptions contains the options for an Analytics query to KV ingest.

func DefaultAnalyticsIngestOptions Uses

func DefaultAnalyticsIngestOptions() *AnalyticsIngestOptions

DefaultAnalyticsIngestOptions creates a new AnalyticsIngestOptions from a set of defaults.

UNCOMMITTED: This API may change.

func (*AnalyticsIngestOptions) AnalyticsTimeout Uses

func (ai *AnalyticsIngestOptions) AnalyticsTimeout(timeout time.Duration) *AnalyticsIngestOptions

AnalyticsTimeout sets the timeout value that will be used for execution of the AnalyticsQuery.

func (*AnalyticsIngestOptions) DataConverter Uses

func (ai *AnalyticsIngestOptions) DataConverter(fn DataConverterFunction) *AnalyticsIngestOptions

DataConverter sets the DataConverterFunction to use for conversion of Analytics documents to KV documents.

func (*AnalyticsIngestOptions) IdGenerator Uses

func (ai *AnalyticsIngestOptions) IdGenerator(fn IdGeneratorFunction) *AnalyticsIngestOptions

IdGenerator sets the IdGeneratorFunction to use for generation of IDs

func (*AnalyticsIngestOptions) IgnoreIngestError Uses

func (ai *AnalyticsIngestOptions) IgnoreIngestError(ignore bool) *AnalyticsIngestOptions

IgnoreIngestError sets whether errors will be ignored when performing KV operations

func (*AnalyticsIngestOptions) IngestMethod Uses

func (ai *AnalyticsIngestOptions) IngestMethod(method ingestMethod) *AnalyticsIngestOptions

IngestMethod sets ingestMethod that will be used for KV operations

func (*AnalyticsIngestOptions) KVRetryBehavior Uses

func (ai *AnalyticsIngestOptions) KVRetryBehavior(behavior QueryRetryBehavior) *AnalyticsIngestOptions

KVRetryBehavior sets the QueryRetryBehavior to use for retrying KV operations when a temporary or overload error occurs.

func (*AnalyticsIngestOptions) KVRetryOn Uses

func (ai *AnalyticsIngestOptions) KVRetryOn(errors []error) *AnalyticsIngestOptions

KVRetryOn sets the errors to perform retries on for kv operation errors.

type AnalyticsQuery Uses

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

AnalyticsQuery represents a pending Analytics query.

func NewAnalyticsQuery Uses

func NewAnalyticsQuery(statement string) *AnalyticsQuery

NewAnalyticsQuery creates a new AnalyticsQuery object from a query string.

func (*AnalyticsQuery) ContextId Uses

func (aq *AnalyticsQuery) ContextId(clientContextId string) *AnalyticsQuery

ContextId sets the client context id for the request, for use with tracing.

func (*AnalyticsQuery) Deferred Uses

func (aq *AnalyticsQuery) Deferred(deferred bool) *AnalyticsQuery

Deferred sets whether or not the query should be run as a deferred query.

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

func (*AnalyticsQuery) Pretty Uses

func (aq *AnalyticsQuery) Pretty(pretty bool) *AnalyticsQuery

Pretty indicates whether the response should be nicely formatted.

func (*AnalyticsQuery) Priority Uses

func (aq *AnalyticsQuery) Priority(priority bool) *AnalyticsQuery

Priority sets whether or not the query should be run with priority status.

func (*AnalyticsQuery) RawParam Uses

func (aq *AnalyticsQuery) RawParam(name string, value interface{}) *AnalyticsQuery

RawParam allows specifying custom query options.

func (*AnalyticsQuery) ServerSideTimeout Uses

func (aq *AnalyticsQuery) ServerSideTimeout(timeout time.Duration) *AnalyticsQuery

ServerSideTimeout indicates the maximum time to wait for this query to complete.

type AnalyticsResultMetrics Uses

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

AnalyticsResultMetrics encapsulates various metrics gathered during a queries execution.

type AnalyticsResults Uses

type AnalyticsResults interface {
    One(valuePtr interface{}) error
    Next(valuePtr interface{}) bool
    NextBytes() []byte
    Close() error

    RequestId() string
    ClientContextId() string
    Status() string
    Warnings() []AnalyticsWarning
    Signature() interface{}
    Metrics() AnalyticsResultMetrics
    Handle() AnalyticsDeferredResultHandle
}

AnalyticsResults allows access to the results of a 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 AppendOp Uses

type AppendOp struct {
    Key   string
    Value string
    Cas   Cas
    Err   error
    // contains filtered or unexported fields
}

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

type AuthCredsRequest Uses

type AuthCredsRequest struct {
    Service  ServiceType
    Endpoint string
    Bucket   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 = "external"
)

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 Bucket Uses

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

Bucket is an interface representing a single bucket within a cluster.

func (*Bucket) AnalyticsIngest Uses

func (b *Bucket) AnalyticsIngest(analyticsQuery *AnalyticsQuery, analyticsParams []interface{}, opts *AnalyticsIngestOptions) error

AnalyticsIngest executes an Analytics query and inserts/updates/replaces the transformed results into a bucket.

UNCOMMITTED: This API may change.

func (*Bucket) AnalyticsTimeout Uses

func (b *Bucket) AnalyticsTimeout() time.Duration

AnalyticsTimeout returns the maximum amount of time to wait for an Analytics query to complete.

func (*Bucket) Append Uses

func (b *Bucket) Append(key, value string) (Cas, error)

Append appends a string value to a document.

func (*Bucket) AppendDura Uses

func (b *Bucket) AppendDura(key, value string, replicateTo, persistTo uint) (Cas, error)

AppendDura appends a string value to a document. Additionally checks document durability.

func (*Bucket) AppendMt Uses

func (b *Bucket) AppendMt(key, value string) (Cas, MutationToken, error)

AppendMt performs a Append operation and includes MutationToken in the results.

func (*Bucket) BulkOperationTimeout Uses

func (b *Bucket) BulkOperationTimeout() time.Duration

BulkOperationTimeout returns the maximum amount of time to wait for a bulk op to succeed.

func (*Bucket) Close Uses

func (b *Bucket) Close() error

Close the instance’s underlying socket resources. Note that operations pending on the connection may fail.

func (*Bucket) Counter Uses

func (b *Bucket) Counter(key string, delta, initial int64, expiry uint32) (uint64, Cas, error)

Counter performs an atomic addition or 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 (*Bucket) CounterDura Uses

func (b *Bucket) CounterDura(key string, delta, initial int64, expiry uint32, replicateTo, persistTo uint) (uint64, Cas, error)

CounterDura performs an atomic addition or subtraction for an integer document. Additionally checks document durability.

func (*Bucket) CounterMt Uses

func (b *Bucket) CounterMt(key string, delta, initial int64, expiry uint32) (uint64, Cas, MutationToken, error)

CounterMt performs a Counter operation and includes MutationToken in the results.

func (*Bucket) Diagnostics Uses

func (bucket *Bucket) Diagnostics() (*DiagnosticReport, error)

Diagnostics returns information about the internal state of the SDK.

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

func (*Bucket) Do Uses

func (b *Bucket) Do(ops []BulkOp) error

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

func (*Bucket) DurabilityPollTimeout Uses

func (b *Bucket) DurabilityPollTimeout() time.Duration

DurabilityPollTimeout returns the amount of time waiting between durability polls.

func (*Bucket) DurabilityTimeout Uses

func (b *Bucket) DurabilityTimeout() time.Duration

DurabilityTimeout returns the maximum amount of time to wait for durability to succeed.

func (*Bucket) ExecuteAnalyticsQuery Uses

func (b *Bucket) ExecuteAnalyticsQuery(q *AnalyticsQuery, params interface{}) (AnalyticsResults, error)

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

func (*Bucket) ExecuteN1qlQuery Uses

func (b *Bucket) ExecuteN1qlQuery(q *N1qlQuery, params interface{}) (QueryResults, error)

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

func (*Bucket) ExecuteSearchQuery Uses

func (b *Bucket) ExecuteSearchQuery(q *SearchQuery) (SearchResults, error)

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

func (*Bucket) ExecuteSpatialQuery Uses

func (b *Bucket) ExecuteSpatialQuery(q *SpatialQuery) (ViewResults, error)

ExecuteSpatialQuery performs a spatial query and returns a list of rows or an error.

func (*Bucket) ExecuteViewQuery Uses

func (b *Bucket) ExecuteViewQuery(q *ViewQuery) (ViewResults, error)

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

func (*Bucket) Get Uses

func (b *Bucket) Get(key string, valuePtr interface{}) (Cas, error)

Get retrieves a document from the bucket

func (*Bucket) GetAndLock Uses

func (b *Bucket) GetAndLock(key string, lockTime uint32, valuePtr interface{}) (Cas, error)

GetAndLock locks a document for a period of time, providing exclusive RW access to it.

func (*Bucket) GetAndTouch Uses

func (b *Bucket) GetAndTouch(key string, expiry uint32, valuePtr interface{}) (Cas, error)

GetAndTouch retrieves a document and simultaneously updates its expiry time.

func (*Bucket) GetReplica Uses

func (b *Bucket) GetReplica(key string, valuePtr interface{}, replicaIdx int) (Cas, error)

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

func (*Bucket) Insert Uses

func (b *Bucket) Insert(key string, value interface{}, expiry uint32) (Cas, error)

Insert inserts a new document to the bucket.

func (*Bucket) InsertDura Uses

func (b *Bucket) InsertDura(key string, value interface{}, expiry uint32, replicateTo, persistTo uint) (Cas, error)

InsertDura inserts a new document to the bucket. Additionally checks document durability.

func (*Bucket) InsertMt Uses

func (b *Bucket) InsertMt(key string, value interface{}, expiry uint32) (Cas, MutationToken, error)

InsertMt performs a Insert operation and includes MutationToken in the results.

func (*Bucket) Internal Uses

func (b *Bucket) Internal() *BucketInternal

Internal methods, not safe to be consumed by third parties.

func (*Bucket) InvalidateQueryCache Uses

func (b *Bucket) InvalidateQueryCache()

InvalidateQueryCache forces the internal cache of prepared queries to be cleared.

Queries to be cached are controlled by the Adhoc() method of N1qlQuery.

func (*Bucket) IoRouter Uses

func (b *Bucket) IoRouter() *gocbcore.Agent

IoRouter returns the underlying gocb agent managing connections.

func (*Bucket) ListAppend Uses

func (b *Bucket) ListAppend(key string, value interface{}, createList bool) (Cas, error)

ListAppend inserts an item to the end of a list document.

func (*Bucket) ListGet Uses

func (b *Bucket) ListGet(key string, index uint, valuePtr interface{}) (Cas, error)

ListGet retrieves an item from a list document by index.

func (*Bucket) ListPrepend Uses

func (b *Bucket) ListPrepend(key string, value interface{}, createList bool) (Cas, error)

ListPrepend inserts an item to the beginning of a list document.

func (*Bucket) ListRemove Uses

func (b *Bucket) ListRemove(key string, index uint) (Cas, error)

ListRemove removes an item from a list document by its index.

func (*Bucket) ListSet Uses

func (b *Bucket) ListSet(key string, index uint, value interface{}) (Cas, error)

ListSet replaces the item at a particular index of a list document.

func (*Bucket) ListSize Uses

func (b *Bucket) ListSize(key string) (uint, Cas, error)

ListSize returns the current number of items in a list. PERFORMANCE NOTICE: This currently performs a full document fetch...

func (*Bucket) LookupIn Uses

func (b *Bucket) LookupIn(key string) *LookupInBuilder

LookupIn creates a sub-document lookup operation builder.

func (*Bucket) LookupInEx Uses

func (b *Bucket) LookupInEx(key string, flags SubdocDocFlag) *LookupInBuilder

LookupInEx creates a sub-document lookup operation builder.

func (*Bucket) Manager Uses

func (b *Bucket) Manager(username, password string) *BucketManager

Manager returns a BucketManager for performing management operations on this bucket.

func (*Bucket) MapAdd Uses

func (b *Bucket) MapAdd(key, path string, value interface{}, createMap bool) (Cas, error)

MapAdd inserts an item to a map document.

func (*Bucket) MapGet Uses

func (b *Bucket) MapGet(key, path string, valuePtr interface{}) (Cas, error)

MapGet retrieves a single item from a map document by its key.

func (*Bucket) MapRemove Uses

func (b *Bucket) MapRemove(key, path string) (Cas, error)

MapRemove removes a specified key from the specified map document.

func (*Bucket) MapSize Uses

func (b *Bucket) MapSize(key string) (uint, Cas, error)

MapSize returns the current number of items in a map document. PERFORMANCE NOTICE: This currently performs a full document fetch...

func (*Bucket) MutateIn Uses

func (b *Bucket) MutateIn(key string, cas Cas, expiry uint32) *MutateInBuilder

MutateIn creates a sub-document mutation operation builder.

func (*Bucket) MutateInEx Uses

func (b *Bucket) MutateInEx(key string, flags SubdocDocFlag, cas Cas, expiry uint32) *MutateInBuilder

MutateInEx creates a sub-document mutation operation builder.

func (*Bucket) MutateInExDura Uses

func (b *Bucket) MutateInExDura(key string, flags SubdocDocFlag, cas Cas, expiry uint32, replicaTo, persistTo uint) *MutateInBuilder

MutateInExDura creates a sub-document mutation operation builder with durability.

func (*Bucket) N1qlTimeout Uses

func (b *Bucket) N1qlTimeout() time.Duration

N1qlTimeout returns the maximum amount of time to wait for a N1QL query to complete.

func (*Bucket) Name Uses

func (b *Bucket) Name() string

Name returns the name of the bucket we are connected to.

func (*Bucket) OperationTimeout Uses

func (b *Bucket) OperationTimeout() time.Duration

OperationTimeout returns the maximum amount of time to wait for an operation to succeed.

func (*Bucket) Ping Uses

func (b *Bucket) Ping(services []ServiceType) (*PingReport, error)

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

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

func (*Bucket) Prepend Uses

func (b *Bucket) Prepend(key, value string) (Cas, error)

Prepend prepends a string value to a document.

func (*Bucket) PrependDura Uses

func (b *Bucket) PrependDura(key, value string, replicateTo, persistTo uint) (Cas, error)

PrependDura prepends a string value to a document. Additionally checks document durability.

func (*Bucket) PrependMt Uses

func (b *Bucket) PrependMt(key, value string) (Cas, MutationToken, error)

PrependMt performs a Prepend operation and includes MutationToken in the results.

func (*Bucket) QueuePop Uses

func (b *Bucket) QueuePop(key string, valuePtr interface{}) (Cas, error)

QueuePop pops the oldest item from a queue and returns it.

func (*Bucket) QueuePush Uses

func (b *Bucket) QueuePush(key string, value interface{}, createQueue bool) (Cas, error)

QueuePush adds a new item to the end of a queue.

func (*Bucket) QueueSize Uses

func (b *Bucket) QueueSize(key string) (uint, Cas, error)

QueueSize returns the current size of a queue.

func (*Bucket) Remove Uses

func (b *Bucket) Remove(key string, cas Cas) (Cas, error)

Remove removes a document from the bucket.

func (*Bucket) RemoveDura Uses

func (b *Bucket) RemoveDura(key string, cas Cas, replicateTo, persistTo uint) (Cas, error)

RemoveDura removes a document from the bucket. Additionally checks document durability.

func (*Bucket) RemoveMt Uses

func (b *Bucket) RemoveMt(key string, cas Cas) (Cas, MutationToken, error)

RemoveMt performs a Remove operation and includes MutationToken in the results.

func (*Bucket) Replace Uses

func (b *Bucket) Replace(key string, value interface{}, cas Cas, expiry uint32) (Cas, error)

Replace replaces a document in the bucket.

func (*Bucket) ReplaceDura Uses

func (b *Bucket) ReplaceDura(key string, value interface{}, cas Cas, expiry uint32, replicateTo, persistTo uint) (Cas, error)

ReplaceDura replaces a document in the bucket. Additionally checks document durability.

func (*Bucket) ReplaceMt Uses

func (b *Bucket) ReplaceMt(key string, value interface{}, cas Cas, expiry uint32) (Cas, MutationToken, error)

ReplaceMt performs a Replace operation and includes MutationToken in the results.

func (*Bucket) SetAdd Uses

func (b *Bucket) SetAdd(key string, value interface{}, createSet bool) (Cas, error)

SetAdd adds a new value to a set document.

func (*Bucket) SetAnalyticsQueryRetryBehavior Uses

func (b *Bucket) SetAnalyticsQueryRetryBehavior(retryBehavior QueryRetryBehavior)

SetAnalyticsQueryRetryBehavior sets the retry behavior to use for retrying queries.

func (*Bucket) SetAnalyticsTimeout Uses

func (b *Bucket) SetAnalyticsTimeout(timeout time.Duration)

SetAnalyticsTimeout sets the maximum amount of time to wait for an Analytics query to complete.

func (*Bucket) SetBulkOperationTimeout Uses

func (b *Bucket) SetBulkOperationTimeout(timeout time.Duration)

SetBulkOperationTimeout sets the maxium amount of time to wait for a bulk op to succeed.

func (*Bucket) SetDurabilityPollTimeout Uses

func (b *Bucket) SetDurabilityPollTimeout(timeout time.Duration)

SetDurabilityPollTimeout sets the amount of time waiting between durability polls.

func (*Bucket) SetDurabilityTimeout Uses

func (b *Bucket) SetDurabilityTimeout(timeout time.Duration)

SetDurabilityTimeout sets the maximum amount of time to wait for durability to succeed.

func (*Bucket) SetExists Uses

func (b *Bucket) SetExists(key string, value interface{}) (bool, Cas, error)

SetExists checks if a particular value exists within the specified set document. PERFORMANCE WARNING: This performs a full set fetch and compare.

func (*Bucket) SetN1qlTimeout Uses

func (b *Bucket) SetN1qlTimeout(timeout time.Duration)

SetN1qlTimeout sets the maximum amount of time to wait for a N1QL query to complete.

func (*Bucket) SetOperationTimeout Uses

func (b *Bucket) SetOperationTimeout(timeout time.Duration)

SetOperationTimeout sets the maximum amount of time to wait for an operation to succeed.

func (*Bucket) SetRemove Uses

func (b *Bucket) SetRemove(key string, value interface{}) (Cas, error)

SetRemove removes a single specified value from the specified set document. WARNING: This relies on Go's interface{} comparison behaviour! PERFORMANCE WARNING: This performs full set fetch, modify, store cycles.

func (*Bucket) SetSearchQueryRetryBehavior Uses

func (b *Bucket) SetSearchQueryRetryBehavior(retryBehavior QueryRetryBehavior)

SetSearchQueryRetryBehavior sets the retry behavior to use for retrying queries.

func (*Bucket) SetSize Uses

func (b *Bucket) SetSize(key string) (uint, Cas, error)

SetSize returns the current number of values in a set. PERFORMANCE NOTICE: This currently performs a full document fetch...

func (*Bucket) SetTranscoder Uses

func (b *Bucket) SetTranscoder(transcoder Transcoder)

SetTranscoder specifies a Transcoder to use when translating documents from their

raw byte format to Go types and back.

func (*Bucket) SetViewTimeout Uses

func (b *Bucket) SetViewTimeout(timeout time.Duration)

SetViewTimeout sets the maximum amount of time to wait for a view query to complete.

func (*Bucket) Stats Uses

func (b *Bucket) Stats(key string) (ServerStats, error)

Stats returns various server statistics from the cluster.

func (*Bucket) Touch Uses

func (b *Bucket) Touch(key string, cas Cas, expiry uint32) (Cas, error)

Touch touches a document, specifying a new expiry time for it. The Cas value must be 0.

func (*Bucket) TouchDura Uses

func (b *Bucket) TouchDura(key string, cas Cas, expiry uint32, replicateTo, persistTo uint) (Cas, error)

TouchDura touches a document, specifying a new expiry time for it. Additionally checks document durability. The Cas value must be 0.

func (*Bucket) UUID Uses

func (b *Bucket) UUID() string

UUID returns the uuid of the bucket we are connected to.

func (*Bucket) Unlock Uses

func (b *Bucket) Unlock(key string, cas Cas) (Cas, error)

Unlock unlocks a document which was locked with GetAndLock.

func (*Bucket) Upsert Uses

func (b *Bucket) Upsert(key string, value interface{}, expiry uint32) (Cas, error)

Upsert inserts or replaces a document in the bucket.

func (*Bucket) UpsertDura Uses

func (b *Bucket) UpsertDura(key string, value interface{}, expiry uint32, replicateTo, persistTo uint) (Cas, error)

UpsertDura inserts or replaces a document in the bucket. Additionally checks document durability.

func (*Bucket) UpsertMt Uses

func (b *Bucket) UpsertMt(key string, value interface{}, expiry uint32) (Cas, MutationToken, error)

UpsertMt performs a Upsert operation and includes MutationToken in the results.

func (*Bucket) ViewTimeout Uses

func (b *Bucket) ViewTimeout() time.Duration

ViewTimeout returns the maximum amount of time to wait for a view query to complete.

type BucketAuthenticator Uses

type BucketAuthenticator struct {
    Password string
}

BucketAuthenticator provides a password for a single bucket.

type BucketAuthenticatorMap Uses

type BucketAuthenticatorMap map[string]BucketAuthenticator

BucketAuthenticatorMap is a map of bucket name to BucketAuthenticator.

type BucketInternal Uses

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

BucketInternal holds various internally used bucket extension methods.

Internal: This should never be used and is not supported.

func (*BucketInternal) GetRandom Uses

func (bi *BucketInternal) GetRandom(valuePtr interface{}) (string, Cas, error)

GetRandom retrieves a document from the bucket

func (*BucketInternal) RemoveMeta Uses

func (bi *BucketInternal) RemoveMeta(key string, value, extra []byte, datatype uint8,
    options, flags, expiry uint32, cas, revseqno uint64) (Cas, error)

RemoveMeta removes a document (with metadata) from the bucket.

func (*BucketInternal) UpsertMeta Uses

func (bi *BucketInternal) UpsertMeta(key string, value, extra []byte, datatype uint8,
    options, flags, expiry uint32, cas, revseqno uint64) (Cas, error)

UpsertMeta inserts or replaces (with metadata) a document in a bucket.

type BucketManager Uses

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

BucketManager provides methods for performing bucket management operations. See ClusterManager for methods that allow creating and removing buckets themselves.

func (*BucketManager) BuildDeferredIndexes Uses

func (bm *BucketManager) BuildDeferredIndexes() ([]string, error)

BuildDeferredIndexes builds all indexes which are currently in deferred state.

func (*BucketManager) CreateIndex Uses

func (bm *BucketManager) CreateIndex(indexName string, fields []string, ignoreIfExists, deferred bool) error

CreateIndex creates an index over the specified fields.

func (*BucketManager) CreatePrimaryIndex Uses

func (bm *BucketManager) CreatePrimaryIndex(customName string, ignoreIfExists, deferred bool) error

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

func (*BucketManager) DropIndex Uses

func (bm *BucketManager) DropIndex(indexName string, ignoreIfNotExists bool) error

DropIndex drops a specific index by name.

func (*BucketManager) DropPrimaryIndex Uses

func (bm *BucketManager) DropPrimaryIndex(customName string, ignoreIfNotExists bool) error

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

func (*BucketManager) Flush Uses

func (bm *BucketManager) Flush() error

Flush 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) GetDesignDocument Uses

func (bm *BucketManager) GetDesignDocument(name string) (*DesignDocument, error)

GetDesignDocument retrieves a single design document for the given bucket..

func (*BucketManager) GetDesignDocuments Uses

func (bm *BucketManager) GetDesignDocuments() ([]*DesignDocument, error)

GetDesignDocuments will retrieve all design documents for the given bucket.

func (*BucketManager) GetIndexes Uses

func (bm *BucketManager) GetIndexes() ([]IndexInfo, error)

GetIndexes returns a list of all currently registered indexes.

func (*BucketManager) InsertDesignDocument Uses

func (bm *BucketManager) InsertDesignDocument(ddoc *DesignDocument) error

InsertDesignDocument inserts a design document to the given bucket.

func (*BucketManager) RemoveDesignDocument Uses

func (bm *BucketManager) RemoveDesignDocument(name string) error

RemoveDesignDocument will remove a design document from the given bucket.

func (*BucketManager) UpsertDesignDocument Uses

func (bm *BucketManager) UpsertDesignDocument(ddoc *DesignDocument) error

UpsertDesignDocument will insert a design document to the given bucket, or update an existing design document with the same name.

func (*BucketManager) WatchIndexes Uses

func (bm *BucketManager) WatchIndexes(watchList []string, watchPrimary bool, timeout time.Duration) error

WatchIndexes waits for a set of indexes to come online

type BucketSettings Uses

type BucketSettings struct {
    FlushEnabled  bool
    IndexReplicas bool
    Name          string
    Password      string
    Quota         int
    Replicas      int
    Type          BucketType
}

BucketSettings holds information about the settings for a bucket.

type BucketType Uses

type BucketType int

BucketType specifies the kind of bucket

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 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 CertificateAuthenticator Uses

type CertificateAuthenticator struct {
    CertAuthenticator
}

CertificateAuthenticator is included for backwards compatibility only. Deprecated: Use CertAuthenticator instead.

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(connSpecStr string) (*Cluster, error)

Connect creates a new Cluster object for a specific cluster. These options 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.
operation_tracing (bool) - Whether to enable tracing.
n1ql_timeout (int) - Maximum execution time for n1ql queries in ms.
fts_timeout (int) - Maximum execution time for fts searches in ms.
analytics_timeout (int) - Maximum execution time for analytics queries in ms.

func (*Cluster) AnalyticsTimeout Uses

func (c *Cluster) AnalyticsTimeout() time.Duration

AnalyticsTimeout returns the maximum time to wait for a cluster-level Analytics query to complete.

func (*Cluster) Authenticate Uses

func (c *Cluster) Authenticate(auth Authenticator) error

Authenticate specifies an Authenticator interface to use to authenticate with cluster services.

func (*Cluster) Close Uses

func (c *Cluster) Close() error

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

func (*Cluster) ConnectTimeout Uses

func (c *Cluster) ConnectTimeout() time.Duration

ConnectTimeout returns the maximum time to wait when attempting to connect to a bucket.

func (*Cluster) EnhancedErrors Uses

func (c *Cluster) EnhancedErrors() bool

EnhancedErrors returns the current enhanced error message state.

func (*Cluster) ExecuteAnalyticsQuery Uses

func (c *Cluster) ExecuteAnalyticsQuery(q *AnalyticsQuery, params interface{}) (AnalyticsResults, error)

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

func (*Cluster) ExecuteN1qlQuery Uses

func (c *Cluster) ExecuteN1qlQuery(q *N1qlQuery, params interface{}) (QueryResults, error)

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

func (*Cluster) ExecuteSearchQuery Uses

func (c *Cluster) ExecuteSearchQuery(q *SearchQuery) (SearchResults, error)

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

func (*Cluster) FtsTimeout Uses

func (c *Cluster) FtsTimeout() time.Duration

FtsTimeout returns the maximum time to wait for a cluster-level FTS query to complete.

func (*Cluster) InvalidateQueryCache Uses

func (c *Cluster) InvalidateQueryCache()

InvalidateQueryCache forces the internal cache of prepared queries to be cleared.

func (*Cluster) Manager Uses

func (c *Cluster) Manager(username, password string) *ClusterManager

Manager returns a ClusterManager object for performing cluster management operations on this cluster.

func (*Cluster) N1qlTimeout Uses

func (c *Cluster) N1qlTimeout() time.Duration

N1qlTimeout returns the maximum time to wait for a cluster-level N1QL query to complete.

func (*Cluster) NmvRetryDelay Uses

func (c *Cluster) NmvRetryDelay() time.Duration

NmvRetryDelay returns the time to wait between retrying an operation due to not my vbucket.

func (*Cluster) OpenBucket Uses

func (c *Cluster) OpenBucket(bucket, password string) (*Bucket, error)

OpenBucket opens a new connection to the specified bucket.

func (*Cluster) OpenBucketWithMt Uses

func (c *Cluster) OpenBucketWithMt(bucket, password string) (*Bucket, error)

OpenBucketWithMt opens a new connection to the specified bucket and enables mutation tokens. MutationTokens allow you to execute queries and durability requirements with very specific operation-level consistency.

func (*Cluster) OpenStreamingBucket Uses

func (c *Cluster) OpenStreamingBucket(streamName, bucket, password string) (*StreamingBucket, error)

OpenStreamingBucket opens a new connection to the specified bucket for the purpose of streaming data.

func (*Cluster) ServerConnectTimeout Uses

func (c *Cluster) ServerConnectTimeout() time.Duration

ServerConnectTimeout returns the maximum time to attempt to connect to a single node.

func (*Cluster) SetAnalyticsTimeout Uses

func (c *Cluster) SetAnalyticsTimeout(timeout time.Duration)

SetAnalyticsTimeout sets the maximum time to wait for a cluster-level Analytics query to complete.

func (*Cluster) SetConnectTimeout Uses

func (c *Cluster) SetConnectTimeout(timeout time.Duration)

SetConnectTimeout sets the maximum time to wait when attempting to connect to a bucket.

func (*Cluster) SetEnhancedErrors Uses

func (c *Cluster) SetEnhancedErrors(enabled bool)

SetEnhancedErrors sets the current enhanced error message state.

func (*Cluster) SetFtsTimeout Uses

func (c *Cluster) SetFtsTimeout(timeout time.Duration)

SetFtsTimeout sets the maximum time to wait for a cluster-level FTS query to complete.

func (*Cluster) SetN1qlTimeout Uses

func (c *Cluster) SetN1qlTimeout(timeout time.Duration)

SetN1qlTimeout sets the maximum time to wait for a cluster-level N1QL query to complete.

func (*Cluster) SetNmvRetryDelay Uses

func (c *Cluster) SetNmvRetryDelay(delay time.Duration)

SetNmvRetryDelay sets the time to wait between retrying an operation due to not my vbucket.

func (*Cluster) SetServerConnectTimeout Uses

func (c *Cluster) SetServerConnectTimeout(timeout time.Duration)

SetServerConnectTimeout sets the maximum time to attempt to connect to a single node.

func (*Cluster) SetTracer Uses

func (c *Cluster) SetTracer(tracer opentracing.Tracer)

SetTracer allows you to specify a custom tracer to use for this cluster. EXPERIMENTAL

type ClusterAuthenticator Uses

type ClusterAuthenticator struct {
    Buckets  BucketAuthenticatorMap
    Username string
    Password string
}

ClusterAuthenticator implements an Authenticator which uses a list of buckets and passwords.

func (ClusterAuthenticator) Credentials Uses

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

Credentials returns the credentials for a particular service.

type ClusterManager Uses

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

ClusterManager provides methods for performing cluster management operations.

func (*ClusterManager) GetBuckets Uses

func (cm *ClusterManager) GetBuckets() ([]*BucketSettings, error)

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

func (*ClusterManager) GetUser Uses

func (cm *ClusterManager) GetUser(domain AuthDomain, name string) (*User, error)

GetUser returns the data for a particular user

func (*ClusterManager) GetUsers Uses

func (cm *ClusterManager) GetUsers(domain AuthDomain) ([]*User, error)

GetUsers returns a list of all users on the cluster.

func (*ClusterManager) InsertBucket Uses

func (cm *ClusterManager) InsertBucket(settings *BucketSettings) error

InsertBucket creates a new bucket on the cluster.

func (*ClusterManager) Internal Uses

func (cm *ClusterManager) Internal() *ClusterManagerInternal

Internal returns a ClusterManagerInternal internally used cluster manager extension methods.

Internal: This should never be used and is not supported.

func (*ClusterManager) RemoveBucket Uses

func (cm *ClusterManager) RemoveBucket(name string) error

RemoveBucket will delete a bucket from the cluster by name.

func (*ClusterManager) RemoveUser Uses

func (cm *ClusterManager) RemoveUser(domain AuthDomain, name string) error

RemoveUser removes a built-in RBAC user on the cluster.

func (*ClusterManager) SearchIndexManager Uses

func (cm *ClusterManager) SearchIndexManager() *SearchIndexManager

SearchIndexManager returns a SearchIndexManager for performing FTS index management on this cluster Experimental: This API is subject to change at any time.

func (*ClusterManager) UpdateBucket Uses

func (cm *ClusterManager) UpdateBucket(settings *BucketSettings) error

UpdateBucket will update the settings for a specific bucket on the cluster.

func (*ClusterManager) UpsertUser Uses

func (cm *ClusterManager) UpsertUser(domain AuthDomain, name string, settings *UserSettings) error

UpsertUser updates a built-in RBAC user on the cluster.

type ClusterManagerInternal Uses

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

ClusterManagerInternal holds internally used cluster manager extension methods.

Internal: This should never be used and is not supported.

func (*ClusterManagerInternal) GetNodesMetadata Uses

func (cmi *ClusterManagerInternal) GetNodesMetadata() ([]NodeMetadata, error)

GetNodesMetadata returns a list of information about nodes in the cluster.

type ConsistencyMode Uses

type ConsistencyMode int

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

type CounterOp Uses

type CounterOp struct {
    Key     string
    Delta   int64
    Initial int64
    Expiry  uint32
    Cas     Cas
    Value   uint64
    Err     error
    // contains filtered or unexported fields
}

CounterOp represents a type of `BulkOp` used for Counter operations. See BulkOp.

type DataConverterFunction Uses

type DataConverterFunction func(docBytes []byte) (interface{}, error)

DataConverterFunction is called to convert from analytics document format to kv document

type DefaultTranscoder Uses

type DefaultTranscoder struct {
}

DefaultTranscoder implements the default transcoding behaviour of all Couchbase SDKs.

func (DefaultTranscoder) Decode Uses

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

Decode applies the default Couchbase transcoding behaviour to decode into a Go type.

func (DefaultTranscoder) Encode Uses

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

Encode applies the default Couchbase transcoding behaviour to encode a Go type.

type DesignDocument Uses

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

DesignDocument represents a Couchbase design document containing multiple views.

type DiagConnState Uses

type DiagConnState int

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

type DiagnosticEntry Uses

type DiagnosticEntry struct {
    Service      ServiceType
    State        DiagConnState
    LocalAddr    string
    RemoteAddr   string
    LastActivity time.Time
}

DiagnosticEntry represents a single entry in a diagnostics report.

type DiagnosticReport Uses

type DiagnosticReport struct {
    ConfigRev int64
    Services  []DiagnosticEntry
}

DiagnosticReport encapsulates the results of a Diagnostics operation.

func (*DiagnosticReport) MarshalJSON Uses

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

MarshalJSON generates a JSON representation of this diagnostics report.

type DocumentFragment Uses

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

DocumentFragment represents multiple chunks of a full Document.

func (*DocumentFragment) Cas Uses

func (frag *DocumentFragment) Cas() Cas

Cas returns the Cas of the Document

func (*DocumentFragment) Content Uses

func (frag *DocumentFragment) Content(path string, valuePtr interface{}) error

Content retrieves the value of the operation by its path. The path is the path provided to the operation

func (*DocumentFragment) ContentByIndex Uses

func (frag *DocumentFragment) ContentByIndex(idx int, valuePtr interface{}) error

ContentByIndex 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 (*DocumentFragment) Exists Uses

func (frag *DocumentFragment) Exists(path string) bool

Exists checks whether the indicated path exists in this DocumentFragment and no errors were returned from the server.

func (*DocumentFragment) MutationToken Uses

func (frag *DocumentFragment) MutationToken() MutationToken

MutationToken returns the MutationToken for the change represented by this DocumentFragment.

type GetAndTouchOp Uses

type GetAndTouchOp struct {
    Key    string
    Value  interface{}
    Expiry uint32
    Cas    Cas
    Err    error
    // contains filtered or unexported fields
}

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

type GetOp Uses

type GetOp struct {
    Key   string
    Value interface{}
    Cas   Cas
    Err   error
    // contains filtered or unexported fields
}

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

type IdGeneratorFunction Uses

type IdGeneratorFunction func(doc interface{}) (string, error)

IdGeneratorFunction is called to create an ID for a document.

type IndexInfo Uses

type IndexInfo 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"`
}

IndexInfo represents a Couchbase GSI index.

type IndexType Uses

type IndexType string

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

type InsertOp Uses

type InsertOp struct {
    Key    string
    Value  interface{}
    Expiry uint32
    Cas    Cas
    Err    error
    // contains filtered or unexported fields
}

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

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 LookupInBuilder Uses

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

LookupInBuilder is a builder used to create a set of sub-document lookup operations.

func (*LookupInBuilder) Execute Uses

func (set *LookupInBuilder) Execute() (*DocumentFragment, error)

Execute executes this set of lookup operations on the bucket.

func (*LookupInBuilder) Exists Uses

func (set *LookupInBuilder) Exists(path string) *LookupInBuilder

Exists is similar to Get(), 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 .Content (and ignoring the value) or .Exists()

func (*LookupInBuilder) ExistsEx Uses

func (set *LookupInBuilder) ExistsEx(path string, flags SubdocFlag) *LookupInBuilder

ExistsEx allows you to perform a sub-document Exists operation with flags

func (*LookupInBuilder) Get Uses

func (set *LookupInBuilder) Get(path string) *LookupInBuilder

Get indicates a path to be retrieved from the document. The value of the path can later be retrieved (after .Execute()) using the Content or ContentByIndex method. The path syntax follows N1QL's path syntax (e.g. `foo.bar.baz`).

func (*LookupInBuilder) GetCount Uses

func (set *LookupInBuilder) GetCount(path string) *LookupInBuilder

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

func (*LookupInBuilder) GetCountEx Uses

func (set *LookupInBuilder) GetCountEx(path string, flags SubdocFlag) *LookupInBuilder

GetCountEx allows you to perform a sub-document GetCount operation with flags

func (*LookupInBuilder) GetEx Uses

func (set *LookupInBuilder) GetEx(path string, flags SubdocFlag) *LookupInBuilder

GetEx allows you to perform a sub-document Get operation with flags

type MultiError Uses

type MultiError struct {
    Errors []error
}

MultiError encapsulates multiple errors that may be returned by one method.

func (*MultiError) Error Uses

func (e *MultiError) Error() string

type MutateInBuilder Uses

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

MutateInBuilder is a builder used to create a set of sub-document mutation operations.

func (*MutateInBuilder) ArrayAddUnique Uses

func (set *MutateInBuilder) ArrayAddUnique(path string, value interface{}, createParents bool) *MutateInBuilder

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

func (*MutateInBuilder) ArrayAddUniqueEx Uses

func (set *MutateInBuilder) ArrayAddUniqueEx(path string, value interface{}, flags SubdocFlag) *MutateInBuilder

ArrayAddUniqueEx allows you to perform a sub-document ArrayAddUnique operation with flags

func (*MutateInBuilder) ArrayAppend Uses

func (set *MutateInBuilder) ArrayAppend(path string, value interface{}, createParents bool) *MutateInBuilder

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

func (*MutateInBuilder) ArrayAppendEx Uses

func (set *MutateInBuilder) ArrayAppendEx(path string, value interface{}, flags SubdocFlag) *MutateInBuilder

ArrayAppendEx allows you to perform a sub-document ArrayAppend operation with flags

func (*MutateInBuilder) ArrayAppendMulti Uses

func (set *MutateInBuilder) ArrayAppendMulti(path string, values interface{}, createParents bool) *MutateInBuilder

ArrayAppendMulti adds multiple values as elements to an array. `values` must be an array type ArrayAppendMulti("path", []int{1,2,3,4}, true) =>

"path" [..., 1,2,3,4]

This is a more efficient version (at both the network and server levels) of doing ArrayAppend("path", 1, true).ArrayAppend("path", 2, true).ArrayAppend("path", 3, true)

See ArrayAppend() for more information

func (*MutateInBuilder) ArrayAppendMultiEx Uses

func (set *MutateInBuilder) ArrayAppendMultiEx(path string, values interface{}, flags SubdocFlag) *MutateInBuilder

ArrayAppendMultiEx allows you to perform a sub-document ArrayAppendMulti operation with flags

func (*MutateInBuilder) ArrayInsert Uses

func (set *MutateInBuilder) ArrayInsert(path string, value interface{}) *MutateInBuilder

ArrayInsert 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 (*MutateInBuilder) ArrayInsertEx Uses

func (set *MutateInBuilder) ArrayInsertEx(path string, value interface{}, flags SubdocFlag) *MutateInBuilder

ArrayInsertEx allows you to perform a sub-document ArrayInsert operation with flags

func (*MutateInBuilder) ArrayInsertMulti Uses

func (set *MutateInBuilder) ArrayInsertMulti(path string, values interface{}) *MutateInBuilder

ArrayInsertMulti inserts multiple elements at a specified position within the array. See ArrayAppendMulti for more information about multiple element operations, and ArrayInsert for more information about array insertion operations

func (*MutateInBuilder) ArrayInsertMultiEx Uses

func (set *MutateInBuilder) ArrayInsertMultiEx(path string, values interface{}, flags SubdocFlag) *MutateInBuilder

ArrayInsertMultiEx allows you to perform a sub-document ArrayInsertMulti operation with flags

func (*MutateInBuilder) ArrayPrepend Uses

func (set *MutateInBuilder) ArrayPrepend(path string, value interface{}, createParents bool) *MutateInBuilder

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

func (*MutateInBuilder) ArrayPrependEx Uses

func (set *MutateInBuilder) ArrayPrependEx(path string, value interface{}, flags SubdocFlag) *MutateInBuilder

ArrayPrependEx allows you to perform a sub-document ArrayPrepend operation with flags

func (*MutateInBuilder) ArrayPrependMulti Uses

func (set *MutateInBuilder) ArrayPrependMulti(path string, values interface{}, createParents bool) *MutateInBuilder

ArrayPrependMulti adds multiple values at the beginning of an array. See ArrayAppendMulti for more information about multiple element operations and ArrayPrepend for the semantics of this operation

func (*MutateInBuilder) ArrayPrependMultiEx Uses

func (set *MutateInBuilder) ArrayPrependMultiEx(path string, values interface{}, flags SubdocFlag) *MutateInBuilder

ArrayPrependMultiEx allows you to perform a sub-document ArrayPrependMulti operation with flags

func (*MutateInBuilder) Counter Uses

func (set *MutateInBuilder) Counter(path string, delta int64, createParents bool) *MutateInBuilder

Counter adds an counter operation to this mutation operation set.

func (*MutateInBuilder) CounterEx Uses

func (set *MutateInBuilder) CounterEx(path string, delta int64, flags SubdocFlag) *MutateInBuilder

CounterEx allows you to perform a sub-document Counter operation with flags

func (*MutateInBuilder) Execute Uses

func (set *MutateInBuilder) Execute() (*DocumentFragment, error)

Execute executes this set of mutation operations on the bucket.

func (*MutateInBuilder) Insert Uses

func (set *MutateInBuilder) Insert(path string, value interface{}, createParents bool) *MutateInBuilder

Insert adds an insert operation to this mutation operation set.

func (*MutateInBuilder) InsertEx Uses

func (set *MutateInBuilder) InsertEx(path string, value interface{}, flags SubdocFlag) *MutateInBuilder

InsertEx allows you to perform a sub-document Insert operation with flags

func (*MutateInBuilder) Remove Uses

func (set *MutateInBuilder) Remove(path string) *MutateInBuilder

Remove adds an remove operation to this mutation operation set.

func (*MutateInBuilder) RemoveEx Uses

func (set *MutateInBuilder) RemoveEx(path string, flags SubdocFlag) *MutateInBuilder

RemoveEx allows you to perform a sub-document Remove operation with flags

func (*MutateInBuilder) Replace Uses

func (set *MutateInBuilder) Replace(path string, value interface{}) *MutateInBuilder

Replace adds an replace operation to this mutation operation set.

func (*MutateInBuilder) ReplaceEx Uses

func (set *MutateInBuilder) ReplaceEx(path string, value interface{}, flags SubdocFlag) *MutateInBuilder

ReplaceEx allows you to perform a sub-document Replace operation with flags

func (*MutateInBuilder) Upsert Uses

func (set *MutateInBuilder) Upsert(path string, value interface{}, createParents bool) *MutateInBuilder

Upsert adds an upsert operation to this mutation operation set.

func (*MutateInBuilder) UpsertEx Uses

func (set *MutateInBuilder) UpsertEx(path string, value interface{}, flags SubdocFlag) *MutateInBuilder

UpsertEx allows you to perform a sub-document Upsert operation with flags

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.

type N1qlQuery Uses

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

N1qlQuery represents a pending N1QL query.

func NewN1qlQuery Uses

func NewN1qlQuery(statement string) *N1qlQuery

NewN1qlQuery creates a new N1qlQuery object from a query string.

func (*N1qlQuery) AdHoc Uses

func (nq *N1qlQuery) AdHoc(adhoc bool) *N1qlQuery

AdHoc specifies that this query is adhoc and should not be prepared.

func (*N1qlQuery) Consistency Uses

func (nq *N1qlQuery) Consistency(stale ConsistencyMode) *N1qlQuery

Consistency specifies the level of consistency required for this query.

func (*N1qlQuery) ConsistentWith Uses

func (nq *N1qlQuery) ConsistentWith(state *MutationState) *N1qlQuery

ConsistentWith specifies a mutation state to be consistent with for this query.

func (*N1qlQuery) Custom Uses

func (nq *N1qlQuery) Custom(name string, value interface{}) *N1qlQuery

Custom allows specifying custom query options.

func (*N1qlQuery) PipelineBatch Uses

func (nq *N1qlQuery) PipelineBatch(pipelineBatch int) *N1qlQuery

PipelineBatch controls the number of items execution operators can batch for fetch from the KV node.

func (*N1qlQuery) PipelineCap Uses

func (nq *N1qlQuery) PipelineCap(pipelineCap int) *N1qlQuery

PipelineCap controls the maximum number of items each execution operator can buffer between various operators.

func (*N1qlQuery) Profile Uses

func (nq *N1qlQuery) Profile(profileMode QueryProfileType) *N1qlQuery

Profile specifies a profiling mode to use for this N1QL query.

func (*N1qlQuery) ReadOnly Uses

func (nq *N1qlQuery) ReadOnly(readOnly bool) *N1qlQuery

ReadOnly controls whether a query can change a resulting recordset. If readonly is true, then only SELECT statements are permitted.

func (*N1qlQuery) ScanCap Uses

func (nq *N1qlQuery) ScanCap(scanCap int) *N1qlQuery

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 0 or a negative number to disable.

func (*N1qlQuery) Timeout Uses

func (nq *N1qlQuery) Timeout(timeout time.Duration) *N1qlQuery

Timeout indicates the maximum time to wait for this query to complete.

type NodeMetadata Uses

type NodeMetadata struct {
    ClusterCompatibility int                `json:"clusterCompatibility"`
    ClusterMembership    string             `json:"clusterMembership"`
    CouchAPIBase         string             `json:"couchApiBase"`
    Hostname             string             `json:"hostname"`
    InterestingStats     map[string]float64 `json:"interestingStats,omitempty"`
    MCDMemoryAllocated   float64            `json:"mcdMemoryAllocated"`
    MCDMemoryReserved    float64            `json:"mcdMemoryReserved"`
    MemoryFree           float64            `json:"memoryFree"`
    MemoryTotal          float64            `json:"memoryTotal"`
    OS                   string             `json:"os"`
    Ports                map[string]int     `json:"ports"`
    Status               string             `json:"status"`
    Uptime               int                `json:"uptime,string"`
    Version              string             `json:"version"`
    ThisNode             bool               `json:"thisNode,omitempty"`
}

NodeMetadata contains information about a node in the cluster.

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 PingReport Uses

type PingReport struct {
    Services []PingServiceEntry
}

PingReport encapsulates the details from a executed ping operation.

func (*PingReport) MarshalJSON Uses

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

MarshalJSON generates a JSON representation of this ping report.

type PingServiceEntry Uses

type PingServiceEntry struct {
    Service  ServiceType
    Endpoint string
    Success  bool
    Latency  time.Duration
}

PingServiceEntry represents a single entry in a ping report.

type PrependOp Uses

type PrependOp struct {
    Key   string
    Value string
    Cas   Cas
    Err   error
    // contains filtered or unexported fields
}

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

type QueryDelayRetryBehavior Uses

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

QueryDelayRetryBehavior provides the behavior to use when retrying queries with a backoff delay

func NewQueryDelayRetryBehavior Uses

func NewQueryDelayRetryBehavior(maxRetries uint, retryDelay uint, delayLimit time.Duration, delayFunc QueryRetryDelayFunction) *QueryDelayRetryBehavior

NewQueryDelayRetryBehavior provides a QueryDelayRetryBehavior that will retry at most maxRetries number of times and with an initial retry delay of retryDelay (ms) up to a maximum delay of delayLimit

func (*QueryDelayRetryBehavior) CanRetry Uses

func (rb *QueryDelayRetryBehavior) CanRetry(retries uint) bool

CanRetry determines whether or not the query can be retried according to the behavior

func (*QueryDelayRetryBehavior) NextInterval Uses

func (rb *QueryDelayRetryBehavior) NextInterval(retries uint) time.Duration

NextInterval calculates what the next retry interval (ms) should be given how many retries there have been already

type QueryProfileType Uses

type QueryProfileType string

QueryProfileType specifies the profiling mode to use during a query.

type QueryResultMetrics Uses

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

QueryResultMetrics encapsulates various metrics gathered during a queries execution.

type QueryResults Uses

type QueryResults interface {
    One(valuePtr interface{}) error
    Next(valuePtr interface{}) bool
    NextBytes() []byte
    Close() error

    RequestId() string
    ClientContextId() string
    Metrics() QueryResultMetrics

    // SourceAddr returns the source endpoint where the request was sent to.
    // VOLATILE
    SourceEndpoint() string
}

QueryResults allows access to the results of a N1QL query.

type QueryRetryBehavior Uses

type QueryRetryBehavior interface {
    NextInterval(retries uint) time.Duration
    CanRetry(retries uint) bool
}

QueryRetryBehavior defines the behavior to be used when retrying queries

type QueryRetryDelayFunction Uses

type QueryRetryDelayFunction func(retryDelay uint, retries uint) time.Duration

QueryRetryDelayFunction is called to get the next try delay

type RemoveOp Uses

type RemoveOp struct {
    Key string
    Cas Cas
    Err error
    // contains filtered or unexported fields
}

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

type ReplaceOp Uses

type ReplaceOp struct {
    Key    string
    Value  interface{}
    Expiry uint32
    Cas    Cas
    Err    error
    // contains filtered or unexported fields
}

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

type SearchHighlightStyle Uses

type SearchHighlightStyle string

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

type SearchIndexDefinitionBuilder Uses

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

SearchIndexDefinitionBuilder provides methods for building a Couchbase FTS index.

func (*SearchIndexDefinitionBuilder) AddField Uses

func (b *SearchIndexDefinitionBuilder) AddField(name string, value interface{}) *SearchIndexDefinitionBuilder

AddField adds a field with the specified name to the Couchbase FTS index being built

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) CreateIndex Uses

func (sim *SearchIndexManager) CreateIndex(builder SearchIndexDefinitionBuilder) error

CreateIndex creates a FTS index with the specific definition.

func (*SearchIndexManager) DeleteIndex Uses

func (sim *SearchIndexManager) DeleteIndex(indexName string) (bool, error)

DeleteIndex removes the FTS index with the specific name.

func (*SearchIndexManager) GetAllIndexDefinitions Uses

func (sim *SearchIndexManager) GetAllIndexDefinitions() ([]interface{}, error)

GetAllIndexDefinitions retrieves all of the FTS indexes for the cluster.

func (*SearchIndexManager) GetAllIndexPartitionInfo Uses

func (sim *SearchIndexManager) GetAllIndexPartitionInfo() (interface{}, error)

GetAllIndexPartitionInfo retrieves all index partition information.

func (*SearchIndexManager) GetAllIndexStats Uses

func (sim *SearchIndexManager) GetAllIndexStats() (interface{}, error)

GetAllIndexStats retrieves all search index stats.

func (*SearchIndexManager) GetIndexDefinition Uses

func (sim *SearchIndexManager) GetIndexDefinition(indexName string) (interface{}, error)

GetIndexDefinition retrieves a specific FTS index by name.

func (*SearchIndexManager) GetIndexPartitionIndexedDocumentCount Uses

func (sim *SearchIndexManager) GetIndexPartitionIndexedDocumentCount(pIndexName string) (int, error)

GetIndexPartitionIndexedDocumentCount retrieves a specific index partition document count.

func (*SearchIndexManager) GetIndexPartitionInfo Uses

func (sim *SearchIndexManager) GetIndexPartitionInfo(pIndexName string) (interface{}, error)

GetIndexPartitionInfo retrieves a specific index partition information.

func (*SearchIndexManager) GetIndexStats Uses

func (sim *SearchIndexManager) GetIndexStats(indexName string) (interface{}, error)

GetIndexStats retrieves search index stats for the specified index.

func (*SearchIndexManager) GetIndexedDocumentCount Uses

func (sim *SearchIndexManager) GetIndexedDocumentCount(indexName string) (int, error)

GetIndexedDocumentCount retrieves the document count for a FTS index.

func (*SearchIndexManager) SetIndexIngestion Uses

func (sim *SearchIndexManager) SetIndexIngestion(indexName string, op string) (bool, error)

SetIndexIngestion sets the FTS index ingestion state.

func (*SearchIndexManager) SetIndexPlanFreeze Uses

func (sim *SearchIndexManager) SetIndexPlanFreeze(indexName string, op string) (bool, error)

SetIndexPlanFreeze sets the FTS index plan freeze state.

func (*SearchIndexManager) SetIndexQuerying Uses

func (sim *SearchIndexManager) SetIndexQuerying(indexName string, op string) (bool, error)

SetIndexQuerying sets the FTS index querying ability state.

type SearchQuery Uses

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

SearchQuery represents a pending search query.

func NewSearchQuery Uses

func NewSearchQuery(indexName string, query interface{}) *SearchQuery

NewSearchQuery creates a new SearchQuery object from an index name and query.

func (*SearchQuery) AddFacet Uses

func (sq *SearchQuery) AddFacet(name string, facet interface{}) *SearchQuery

AddFacet adds a new search facet to include in the results.

func (*SearchQuery) Consistency Uses

func (sq *SearchQuery) Consistency(stale ConsistencyMode) *SearchQuery

Consistency specifies the level of consistency required for this query.

func (*SearchQuery) ConsistentWith Uses

func (sq *SearchQuery) ConsistentWith(state *MutationState) *SearchQuery

ConsistentWith specifies a mutation state to be consistent with for this query.

func (*SearchQuery) Explain Uses

func (sq *SearchQuery) Explain(value bool) *SearchQuery

Explain enables search query explanation which provides details on how a query is executed.

func (*SearchQuery) Fields Uses

func (sq *SearchQuery) Fields(fields ...string) *SearchQuery

Fields specifies which fields you wish to return in the results.

func (*SearchQuery) Highlight Uses

func (sq *SearchQuery) Highlight(style SearchHighlightStyle, fields ...string) *SearchQuery

Highlight specifies how to highlight the hits in the search result.

func (*SearchQuery) Limit Uses

func (sq *SearchQuery) Limit(value int) *SearchQuery

Limit specifies a limit on the number of results to return.

func (*SearchQuery) Skip Uses

func (sq *SearchQuery) Skip(value int) *SearchQuery

Skip specifies how many results to skip at the beginning of the result list.

func (*SearchQuery) Sort Uses

func (sq *SearchQuery) Sort(fields ...interface{}) *SearchQuery

Sort specifies a sorting order for the results. Only available in Couchbase Server 4.6+.

func (*SearchQuery) Timeout Uses

func (sq *SearchQuery) Timeout(value time.Duration) *SearchQuery

Timeout indicates the maximum time to wait for this query to complete.

type SearchResultDateFacet Uses

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

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

type SearchResultFacet Uses

type SearchResultFacet struct {
    Field         string                     `json:"field,omitempty"`
    Total         int                        `json:"total,omitempty"`
    Missing       int                        `json:"missing,omitempty"`
    Other         int                        `json:"other,omitempty"`
    Terms         []SearchResultTermFacet    `json:"terms,omitempty"`
    NumericRanges []SearchResultNumericFacet `json:"numeric_ranges,omitempty"`
    DateRanges    []SearchResultDateFacet    `json:"date_ranges,omitempty"`
}

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

type SearchResultHit Uses

type SearchResultHit 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][]SearchResultLocation `json:"locations,omitempty"`
    Fragments   map[string][]string                          `json:"fragments,omitempty"`
    // Deprecated: See AllFields
    Fields map[string]string `json:"-"`
    // AllFields is to avoid making a breaking change changing the type of Fields. Only
    // fields in the response that are of type string will be put into Fields, all
    // field types will be placed into AllFields.
    AllFields map[string]interface{} `json:"fields,omitempty"`
}

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

type SearchResultLocation Uses

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

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

type SearchResultNumericFacet Uses

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

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

type SearchResultStatus Uses

type SearchResultStatus struct {
    Total      int         `json:"total,omitempty"`
    Failed     int         `json:"failed,omitempty"`
    Successful int         `json:"successful,omitempty"`
    Errors     interface{} `json:"errors,omitempty"`
}

SearchResultStatus holds the status information for an executed search query.

type SearchResultTermFacet Uses

type SearchResultTermFacet struct {
    Term  string `json:"term,omitempty"`
    Count int    `json:"count,omitempty"`
}

SearchResultTermFacet holds the results of a term facet in search results.

type SearchResults Uses

type SearchResults interface {
    Status() SearchResultStatus
    Errors() []string
    TotalHits() int
    Hits() []SearchResultHit
    Facets() map[string]SearchResultFacet
    Took() time.Duration
    MaxScore() float64
}

SearchResults allows access to the results of a search query.

type ServerStats Uses

type ServerStats map[string]map[string]string

ServerStats is a tree of statistics information returned from the server.

stats := cb.Stats(...)
for server := stats {
    for statName, stat := server {
    //...
    }
}

type ServiceType Uses

type ServiceType gocbcore.ServiceType

ServiceType specifies a particular Couchbase service type.

type SortOrder Uses

type SortOrder int

SortOrder specifies the ordering for the view queries results.

type SpatialQuery Uses

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

SpatialQuery represents a pending spatial query.

func NewSpatialQuery Uses

func NewSpatialQuery(ddoc, name string) *SpatialQuery

NewSpatialQuery creates a new SpatialQuery object from a design document and view name.

func (*SpatialQuery) Bbox Uses

func (vq *SpatialQuery) Bbox(bounds []float64) *SpatialQuery

Bbox specifies the bounding region to use for the spatial query.

func (*SpatialQuery) Custom Uses

func (vq *SpatialQuery) Custom(name, value string) *SpatialQuery

Custom allows specifying custom query options.

func (*SpatialQuery) Development Uses

func (vq *SpatialQuery) Development(val bool) *SpatialQuery

Development specifies whether to query the production or development design document.

func (*SpatialQuery) Limit Uses

func (vq *SpatialQuery) Limit(num uint) *SpatialQuery

Limit specifies a limit on the number of results to return.

func (*SpatialQuery) Skip Uses

func (vq *SpatialQuery) Skip(num uint) *SpatialQuery

Skip specifies how many results to skip at the beginning of the result list.

func (*SpatialQuery) Stale Uses

func (vq *SpatialQuery) Stale(stale StaleMode) *SpatialQuery

Stale specifies the level of consistency required for this query.

type StaleMode Uses

type StaleMode int

StaleMode specifies the consistency required for a view query.

type StreamingBucket Uses

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

StreamingBucket represents a bucket connection used for streaming data over DCP.

func (*StreamingBucket) IoRouter Uses

func (b *StreamingBucket) IoRouter() *gocbcore.Agent

IoRouter returns the underlying gocb agent managing connections.

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 ThresholdLoggingTracer Uses

type ThresholdLoggingTracer struct {
    Interval           time.Duration
    SampleSize         uint32
    KvThreshold        time.Duration
    ViewsThreshold     time.Duration
    N1qlThreshold      time.Duration
    SearchThreshold    time.Duration
    AnalyticsThreshold time.Duration
    // contains filtered or unexported fields
}

ThresholdLoggingTracer is a specialized Tracer implementation which will automatically log operations which fall outside of a set of thresholds. Note that this tracer is only safe for use within the Couchbase SDK, uses by external event sources are likely to fail. EXPERIMENTAL

func (*ThresholdLoggingTracer) AddRef Uses

func (t *ThresholdLoggingTracer) AddRef() int32

AddRef is used internally to keep track of the number of Cluster instances referring to it. This is used to correctly shut down the aggregation routines once there are no longer any instances tracing to it.

func (*ThresholdLoggingTracer) DecRef Uses

func (t *ThresholdLoggingTracer) DecRef() int32

DecRef is the counterpart to AddRef (see AddRef for more information).

func (*ThresholdLoggingTracer) Extract Uses

func (t *ThresholdLoggingTracer) Extract(format interface{}, carrier interface{}) (opentracing.SpanContext, error)

Extract belongs to the Tracer interface.

func (*ThresholdLoggingTracer) Inject Uses

func (t *ThresholdLoggingTracer) Inject(sp opentracing.SpanContext, format interface{}, carrier interface{}) error

Inject belongs to the Tracer interface.

func (*ThresholdLoggingTracer) StartSpan Uses

func (t *ThresholdLoggingTracer) StartSpan(operationName string, opts ...opentracing.StartSpanOption) opentracing.Span

StartSpan belongs to the Tracer interface.

type TouchOp Uses

type TouchOp struct {
    Key    string
    Expiry uint32
    Cas    Cas
    Err    error
    // contains filtered or unexported fields
}

TouchOp represents a type of `BulkOp` used for Touch operations. See BulkOp.

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 UpsertOp Uses

type UpsertOp struct {
    Key    string
    Value  interface{}
    Expiry uint32
    Cas    Cas
    Err    error
    // contains filtered or unexported fields
}

UpsertOp represents a type of `BulkOp` used for Upsert operations. See BulkOp.

type User Uses

type User struct {
    Id    string
    Name  string
    Type  string
    Roles []UserRole
}

User represents a user which was retrieved from the server.

type UserPassPair Uses

type UserPassPair gocbcore.UserPassPair

UserPassPair represents a username and password pair.

type UserRole Uses

type UserRole struct {
    Role       string
    BucketName string
}

UserRole represents a role for a particular user on the server.

type UserSettings Uses

type UserSettings struct {
    Name     string
    Password string
    Roles    []UserRole
}

UserSettings represents a user during user creation.

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 ViewQuery Uses

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

ViewQuery represents a pending view query.

func NewViewQuery Uses

func NewViewQuery(ddoc, name string) *ViewQuery

NewViewQuery creates a new ViewQuery object from a design document and view name.

func (*ViewQuery) Custom Uses

func (vq *ViewQuery) Custom(name, value string) *ViewQuery

Custom allows specifying custom query options.

func (*ViewQuery) Development Uses

func (vq *ViewQuery) Development(val bool) *ViewQuery

Development specifies whether to query the production or development design document.

func (*ViewQuery) Group Uses

func (vq *ViewQuery) Group(useGrouping bool) *ViewQuery

Group specifies whether to group the map-reduce results.

func (*ViewQuery) GroupLevel Uses

func (vq *ViewQuery) GroupLevel(groupLevel uint) *ViewQuery

GroupLevel specifies at what level to group the map-reduce results.

func (*ViewQuery) IdRange Uses

func (vq *ViewQuery) IdRange(start, end string) *ViewQuery

IdRange specifies a range of document id's to get results within. Usually requires Range to be specified as well.

func (*ViewQuery) Key Uses

func (vq *ViewQuery) Key(key interface{}) *ViewQuery

Key specifies a specific key to retrieve from the index.

func (*ViewQuery) Keys Uses

func (vq *ViewQuery) Keys(keys []interface{}) *ViewQuery

Keys specifies a list of specific keys to retrieve from the index.

func (*ViewQuery) Limit Uses

func (vq *ViewQuery) Limit(num uint) *ViewQuery

Limit specifies a limit on the number of results to return.

func (*ViewQuery) Order Uses

func (vq *ViewQuery) Order(order SortOrder) *ViewQuery

Order specifies the order to sort the view results in.

func (*ViewQuery) Range Uses

func (vq *ViewQuery) Range(start, end interface{}, inclusiveEnd bool) *ViewQuery

Range specifies a value range to get results within.

func (*ViewQuery) Reduce Uses

func (vq *ViewQuery) Reduce(reduce bool) *ViewQuery

Reduce specifies whether to run the reduce part of the map-reduce.

func (*ViewQuery) Skip Uses

func (vq *ViewQuery) Skip(num uint) *ViewQuery

Skip specifies how many results to skip at the beginning of the result list.

func (*ViewQuery) Stale Uses

func (vq *ViewQuery) Stale(stale StaleMode) *ViewQuery

Stale specifies the level of consistency required for this query.

type ViewResultMetrics Uses

type ViewResultMetrics interface {
    TotalRows() int
}

ViewResultMetrics allows access to the TotalRows value from the view response. This is implemented as an additional interface to maintain ABI compatibility for the 1.x series.

type ViewResults Uses

type ViewResults interface {
    One(valuePtr interface{}) error
    Next(valuePtr interface{}) bool
    NextBytes() []byte
    Close() error
}

ViewResults implements an iterator interface which can be used to iterate over the rows of the query results.

Directories

PathSynopsis
cbft

Package gocb imports 25 packages (graph) and is imported by 13 packages. Updated 2019-06-28. Refresh now. Tools for package owners.