Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultDecode(bytes []byte, flags uint32, out interface{}) error
- func DefaultEncode(value interface{}) ([]byte, uint32, error)
- func ErrorCause(err error) error
- func ExponentialDelayFunction(retryDelay uint, retries uint) time.Duration
- func IsAccessError(err error) bool
- func IsAuthenticationError(err error) bool
- func IsBucketMissingError(err error) bool
- func IsCollectionMissingError(err error) bool
- func IsConfigurationError(err error) bool
- func IsDurabilityError(err error) bool
- func IsHTTPError(err error) bool
- func IsInvalidRangeError(err error) bool
- func IsKeyExistsError(err error) bool
- func IsKeyLockedError(err error) bool
- func IsKeyNotFoundError(err error) bool
- func IsNetworkError(err error) bool
- func IsNoResultsError(err error) bool
- func IsPathExistsError(err error) bool
- func IsPathNotFoundError(err error) bool
- func IsScopeMissingError(err error) bool
- func IsServiceNotFoundError(err error) bool
- func IsSubdocPathExistsError(err error) bool
- func IsSubdocPathNotFoundError(err error) bool
- func IsTempFailError(err error) bool
- func IsTimeoutError(err error) bool
- func IsValueTooBigError(err error) bool
- func JSONDecode(bytes []byte, _ uint32, out interface{}) error
- func JSONEncode(value interface{}) ([]byte, uint32, error)
- func LinearDelayFunction(retryDelay uint, retries uint) time.Duration
- func SetLogRedactionLevel(level LogRedactLevel)
- func SetLogger(logger Logger)
- func Version() string
- type AnalyticsDeferredResultHandle
- func (r *AnalyticsDeferredResultHandle) Close() error
- func (r *AnalyticsDeferredResultHandle) Next(valuePtr interface{}) bool
- func (r *AnalyticsDeferredResultHandle) NextBytes() []byte
- func (r *AnalyticsDeferredResultHandle) One(valuePtr interface{}) error
- func (r *AnalyticsDeferredResultHandle) Status() (string, error)
- type AnalyticsQueryError
- type AnalyticsQueryErrors
- type AnalyticsQueryOptions
- type AnalyticsResultMetrics
- type AnalyticsResults
- func (r *AnalyticsResults) Close() error
- func (r *AnalyticsResults) Handle() *AnalyticsDeferredResultHandle
- func (r *AnalyticsResults) Metadata() (*AnalyticsResultsMetadata, error)
- func (r *AnalyticsResults) Next(valuePtr interface{}) bool
- func (r *AnalyticsResults) NextBytes() []byte
- func (r *AnalyticsResults) One(valuePtr interface{}) error
- type AnalyticsResultsMetadata
- func (r *AnalyticsResultsMetadata) ClientContextID() string
- func (r *AnalyticsResultsMetadata) Metrics() AnalyticsResultMetrics
- func (r *AnalyticsResultsMetadata) RequestID() string
- func (r *AnalyticsResultsMetadata) Signature() interface{}
- func (r *AnalyticsResultsMetadata) Status() string
- func (r *AnalyticsResultsMetadata) Warnings() []AnalyticsWarning
- type AnalyticsWarning
- type AppendOptions
- type AuthCredsRequest
- type Authenticator
- type BooleanFieldQuery
- type BooleanQuery
- func (q *BooleanQuery) Boost(boost float32) *BooleanQuery
- func (q *BooleanQuery) MarshalJSON() ([]byte, error)
- func (q *BooleanQuery) Must(query FtsQuery) *BooleanQuery
- func (q *BooleanQuery) MustNot(query FtsQuery) *BooleanQuery
- func (q *BooleanQuery) Should(query FtsQuery) *BooleanQuery
- func (q *BooleanQuery) ShouldMin(min int) *BooleanQuery
- type Bucket
- func (b *Bucket) Collection(scopeName string, collectionName string, opts *CollectionOptions) *Collection
- func (b *Bucket) DefaultCollection(opts *CollectionOptions) *Collection
- func (b *Bucket) Name() string
- func (b *Bucket) Scope(scopeName string) *Scope
- func (b *Bucket) SpatialViewQuery(designDoc string, viewName string, opts *SpatialViewOptions) (*ViewResults, error)
- func (b *Bucket) ViewQuery(designDoc string, viewName string, opts *ViewOptions) (*ViewResults, error)
- type BucketOptions
- type Cas
- type CertAuthenticator
- type Cluster
- func (c *Cluster) AnalyticsQuery(statement string, opts *AnalyticsQueryOptions) (*AnalyticsResults, error)
- func (c *Cluster) Bucket(bucketName string, opts *BucketOptions) *Bucket
- func (c *Cluster) Close(opts *ClusterCloseOptions) error
- func (c *Cluster) Query(statement string, opts *QueryOptions) (*QueryResults, error)
- func (c *Cluster) SearchQuery(q SearchQuery, opts *SearchQueryOptions) (*SearchResults, error)
- type ClusterCloseOptions
- type ClusterOptions
- type Collection
- func (c *Collection) Binary() *CollectionBinary
- func (c *Collection) Exists(key string, opts *ExistsOptions) (docOut *ExistsResult, errOut error)
- func (c *Collection) Get(key string, opts *GetOptions) (docOut *GetResult, errOut error)
- func (c *Collection) GetAllReplicas(key string, opts *GetFromReplicaOptions) (docOut *GetAllReplicasResult, errOut error)
- func (c *Collection) GetAndLock(key string, expiration uint32, opts *GetAndLockOptions) (docOut *GetResult, errOut error)
- func (c *Collection) GetAndTouch(key string, expiration uint32, opts *GetAndTouchOptions) (docOut *GetResult, errOut error)
- func (c *Collection) GetAnyReplica(key string, opts *GetFromReplicaOptions) (docOut *GetReplicaResult, errOut error)
- func (c *Collection) Insert(key string, val interface{}, opts *InsertOptions) (mutOut *MutationResult, errOut error)
- func (c *Collection) LookupIn(key string, ops []LookupInOp, opts *LookupInOptions) (docOut *LookupInResult, errOut error)
- func (c *Collection) MutateIn(key string, ops []MutateInOp, opts *MutateInOptions) (mutOut *MutateInResult, errOut error)
- func (c *Collection) Remove(key string, opts *RemoveOptions) (mutOut *MutationResult, errOut error)
- func (c *Collection) Replace(key string, val interface{}, opts *ReplaceOptions) (mutOut *MutationResult, errOut error)
- func (c *Collection) Touch(key string, expiration uint32, opts *TouchOptions) (mutOut *MutationResult, errOut error)
- func (c *Collection) Unlock(key string, opts *UnlockOptions) (mutOut *MutationResult, errOut error)
- func (c *Collection) Upsert(key string, val interface{}, opts *UpsertOptions) (mutOut *MutationResult, errOut error)
- type CollectionBinary
- func (c *CollectionBinary) Append(key string, val []byte, opts *AppendOptions) (mutOut *MutationResult, errOut error)
- func (c *CollectionBinary) Decrement(key string, opts *CounterOptions) (countOut *CounterResult, errOut error)
- func (c *CollectionBinary) Increment(key string, opts *CounterOptions) (countOut *CounterResult, errOut error)
- func (c *CollectionBinary) Prepend(key string, val []byte, opts *PrependOptions) (mutOut *MutationResult, errOut error)
- type CollectionOptions
- type ConfigurationError
- type ConjunctionQuery
- type ConsistencyMode
- type CounterOptions
- type CounterResult
- type DateFacet
- type DateRangeQuery
- func (q *DateRangeQuery) Boost(boost float32) *DateRangeQuery
- func (q *DateRangeQuery) DateTimeParser(parser string) *DateRangeQuery
- func (q *DateRangeQuery) End(end string, inclusive bool) *DateRangeQuery
- func (q *DateRangeQuery) Field(field string) *DateRangeQuery
- func (q DateRangeQuery) MarshalJSON() ([]byte, error)
- func (q *DateRangeQuery) Start(start string, inclusive bool) *DateRangeQuery
- type Decode
- type DelayRetryBehavior
- type DisjunctionQuery
- type DocIdQuery
- type DurabilityError
- type DurabilityLevel
- type Encode
- type ExistsOptions
- type ExistsResult
- type FtsFacet
- type FtsQuery
- type FtsSort
- type GeoBoundingBoxQuery
- type GeoDistanceQuery
- type GetAllReplicasResult
- type GetAndLockOptions
- type GetAndTouchOptions
- type GetFromReplicaOptions
- type GetOptions
- type GetReplicaResult
- type GetResult
- type HTTPError
- type IndexType
- type InsertOptions
- type KeyValueError
- type LogLevel
- type LogRedactLevel
- type Logger
- type LookupInOp
- type LookupInOptions
- type LookupInResult
- type LookupInSpec
- func (spec LookupInSpec) Count(path string, opts *LookupInSpecCountOptions) LookupInOp
- func (spec LookupInSpec) Exists(path string, opts *LookupInSpecExistsOptions) LookupInOp
- func (spec LookupInSpec) Get(path string, opts *LookupInSpecGetOptions) LookupInOp
- func (spec LookupInSpec) GetFull(opts *LookupInSpecGetFullOptions) LookupInOp
- type LookupInSpecCountOptions
- type LookupInSpecExistsOptions
- type LookupInSpecGetFullOptions
- type LookupInSpecGetOptions
- type MatchAllQuery
- type MatchNoneQuery
- type MatchPhraseQuery
- type MatchQuery
- func (q *MatchQuery) Analyzer(analyzer string) *MatchQuery
- func (q *MatchQuery) Boost(boost float32) *MatchQuery
- func (q *MatchQuery) Field(field string) *MatchQuery
- func (q *MatchQuery) Fuzziness(fuzziness int) *MatchQuery
- func (q MatchQuery) MarshalJSON() ([]byte, error)
- func (q *MatchQuery) PrefixLength(length int) *MatchQuery
- type MutateInOp
- type MutateInOptions
- type MutateInResult
- type MutateInSpec
- func (spec MutateInSpec) ArrayAddUnique(path string, val interface{}, opts *MutateInSpecArrayAddUniqueOptions) MutateInOp
- func (spec MutateInSpec) ArrayAppend(path string, val interface{}, opts *MutateInSpecArrayAppendOptions) MutateInOp
- func (spec MutateInSpec) ArrayInsert(path string, val interface{}, opts *MutateInSpecArrayInsertOptions) MutateInOp
- func (spec MutateInSpec) ArrayPrepend(path string, val interface{}, opts *MutateInSpecArrayPrependOptions) MutateInOp
- func (spec MutateInSpec) Decrement(path string, delta int64, opts *MutateInSpecCounterOptions) MutateInOp
- func (spec MutateInSpec) Increment(path string, delta int64, opts *MutateInSpecCounterOptions) MutateInOp
- func (spec MutateInSpec) Insert(path string, val interface{}, opts *MutateInSpecInsertOptions) MutateInOp
- func (spec MutateInSpec) Remove(path string, opts *MutateInSpecRemoveOptions) MutateInOp
- func (spec MutateInSpec) RemoveFull() (*MutateInOp, error)
- func (spec MutateInSpec) Replace(path string, val interface{}, opts *MutateInSpecReplaceOptions) MutateInOp
- func (spec MutateInSpec) Upsert(path string, val interface{}, opts *MutateInSpecUpsertOptions) MutateInOp
- func (spec MutateInSpec) UpsertFull(val interface{}, opts *MutateInSpecUpsertFullOptions) MutateInOp
- type MutateInSpecArrayAddUniqueOptions
- type MutateInSpecArrayAppendOptions
- type MutateInSpecArrayInsertOptions
- type MutateInSpecArrayPrependOptions
- type MutateInSpecCounterOptions
- type MutateInSpecInsertOptions
- type MutateInSpecRemoveOptions
- type MutateInSpecReplaceOptions
- type MutateInSpecUpsertFullOptions
- type MutateInSpecUpsertOptions
- type MutationMacro
- type MutationResult
- type MutationState
- type MutationToken
- type NetworkError
- type NoResultsError
- type NodeManager
- type NumericFacet
- type NumericRangeQuery
- func (q *NumericRangeQuery) Boost(boost float32) *NumericRangeQuery
- func (q *NumericRangeQuery) Field(field string) *NumericRangeQuery
- func (q NumericRangeQuery) MarshalJSON() ([]byte, error)
- func (q *NumericRangeQuery) Max(max float32, inclusive bool) *NumericRangeQuery
- func (q *NumericRangeQuery) Min(min float32, inclusive bool) *NumericRangeQuery
- type PasswordAuthenticator
- type PhraseQuery
- type PrefixQuery
- type PrependOptions
- type ProjectOptions
- type ProjectionErrors
- type QueryError
- type QueryErrors
- type QueryOptions
- type QueryProfileType
- type QueryResultMetrics
- type QueryResults
- type QueryResultsMetadata
- func (r *QueryResultsMetadata) ClientContextID() string
- func (r *QueryResultsMetadata) Metrics() QueryResultMetrics
- func (r *QueryResultsMetadata) RequestID() string
- func (r *QueryResultsMetadata) Signature() interface{}
- func (r *QueryResultsMetadata) SourceEndpoint() string
- func (r *QueryResultsMetadata) Warnings() []QueryWarning
- type QueryStringQuery
- type QueryWarning
- type Range
- type RegexpQuery
- type RemoveOptions
- type ReplaceOptions
- type Result
- type RetryBehavior
- type RetryDelayFunction
- type Scope
- type SearchError
- type SearchErrors
- type SearchHighlightOptions
- type SearchHighlightStyle
- type SearchQuery
- type SearchQueryOptions
- type SearchResultDateFacet
- type SearchResultFacet
- type SearchResultHit
- type SearchResultLocation
- type SearchResultNumericFacet
- type SearchResultStatus
- type SearchResultTermFacet
- type SearchResults
- func (r *SearchResults) Close() error
- func (r SearchResults) Facets() (map[string]SearchResultFacet, error)
- func (r *SearchResults) Metadata() (*SearchResultsMetadata, error)
- func (r *SearchResults) Next(hitPtr *SearchResultHit) bool
- func (r *SearchResults) NextBytes() []byte
- func (r *SearchResults) One(hitPtr *SearchResultHit) error
- type SearchResultsMetadata
- type SearchSortField
- func (q *SearchSortField) Descending(descending bool) *SearchSortField
- func (q SearchSortField) MarshalJSON() ([]byte, error)
- func (q *SearchSortField) Missing(missing string) *SearchSortField
- func (q *SearchSortField) Mode(mode string) *SearchSortField
- func (q *SearchSortField) Type(value string) *SearchSortField
- type SearchSortGeoDistance
- type SearchSortId
- type SearchSortScore
- type ServiceNotFoundError
- type ServiceType
- type SortOrder
- type SpatialViewOptions
- type StaleMode
- type SubdocDocFlag
- type SubdocFlag
- type TermFacet
- type TermQuery
- type TermRangeQuery
- func (q *TermRangeQuery) Boost(boost float32) *TermRangeQuery
- func (q *TermRangeQuery) Field(field string) *TermRangeQuery
- func (q TermRangeQuery) MarshalJSON() ([]byte, error)
- func (q *TermRangeQuery) Max(max string, inclusive bool) *TermRangeQuery
- func (q *TermRangeQuery) Min(min string, inclusive bool) *TermRangeQuery
- type TimeoutError
- type TouchOptions
- type UnlockOptions
- type UpsertOptions
- type UserPassPair
- type ViewOptions
- type ViewQueryError
- type ViewQueryErrors
- type ViewResults
- type ViewResultsMetadata
- type ViewRow
- type WildcardQuery
Constants ¶
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 ( // 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 ( // 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 ( // DurabilityLevelMajority specifies that a mutation must be replicated (held in memory) to a majority of nodes. DurabilityLevelMajority = DurabilityLevel(1) // DurabilityLevelMajorityAndPersistActive specifies that a mutation must be replicated (held in memory) to a // majority of nodes and also persisted (written to disk) on the active node. DurabilityLevelMajorityAndPersistActive = DurabilityLevel(2) // DurabilityLevelPersistToMajority specifies that a mutation must be persisted (written to disk) to a majority // of nodes. DurabilityLevelPersistToMajority = DurabilityLevel(3) )
const ( // MutationMacroCAS can be used to tell the server to use the CAS macro. MutationMacroCAS = MutationMacro("${Mutation.CAS}") // MutationMacroSeqNo can be used to tell the server to use the seqno macro. MutationMacroSeqNo = MutationMacro("${Mutation.seqno}") // MutationMacroValueCRC32c can be used to tell the server to use the value_crc32c macro. MutationMacroValueCRC32c = MutationMacro("${Mutation.value_crc32c}") )
const ( LogError = LogLevel(gocbcore.LogError) LogWarn = LogLevel(gocbcore.LogWarn) LogInfo = LogLevel(gocbcore.LogInfo) LogDebug = LogLevel(gocbcore.LogDebug) LogTrace = LogLevel(gocbcore.LogTrace) LogSched = LogLevel(gocbcore.LogSched) LogMaxVerbosity = LogLevel(gocbcore.LogMaxVerbosity) )
Various logging levels (or subsystems) which can categorize the message. Currently these are ordered in decreasing severity.
const ( // RedactNone indicates to perform no redactions RedactNone = LogRedactLevel(0) // RedactPartial indicates to redact all possible user-identifying information from logs. RedactPartial = LogRedactLevel(1) // RedactFull indicates to fully redact all possible identifying information from logs. RedactFull = LogRedactLevel(2) )
const ( // NotBounded indicates no data consistency is required. NotBounded = ConsistencyMode(1) // RequestPlus indicates that request-level data consistency is required. RequestPlus = ConsistencyMode(2) // StatementPlus indicates 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 ( // 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.") // 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 // 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 )
Functions ¶
func DefaultDecode ¶
DefaultDecode applies the default Couchbase transcoding behaviour to decode into a Go type.
func DefaultEncode ¶
DefaultEncode applies the default Couchbase transcoding behaviour to encode a Go type. For a byte array this will return the value supplied with Binary flags. For a string this will return the value supplied with String flags. For anything else this will try to return the value JSON encoded supplied, with JSON flags.
func ErrorCause ¶
ErrorCause returns the underlying cause of an error.
func ExponentialDelayFunction ¶
ExponentialDelayFunction provides retry delay durations (ms) following an exponential increment pattern
func IsAccessError ¶
IsAccessError verifies whether or not the cause for an error is an access error.
func IsAuthenticationError ¶
IsAuthenticationError verifies whether or not the cause for an error is an authentication error.
func IsBucketMissingError ¶
IsBucketMissingError verifies whether or not the cause for an error is a bucket missing error.
func IsCollectionMissingError ¶
IsCollectionMissingError verifies whether or not the cause for an error is scope unknown
func IsConfigurationError ¶
IsConfigurationError verifies whether or not the cause for an error is a configuration error.
func IsDurabilityError ¶
IsDurabilityError verifies whether or not the cause for an error is due to a durability error.
func IsHTTPError ¶
IsHTTPError indicates whether the passed error is a HTTP error.
func IsInvalidRangeError ¶
IsInvalidRangeError indicates whether the passed error is a key-value "requested value is outside range" error.
func IsKeyExistsError ¶
IsKeyExistsError indicates whether the passed error is a key-value "Key Already Exists" error.
func IsKeyLockedError ¶
IsKeyLockedError indicates whether the passed error is a key-value operation failed due to the document being locked.
func IsKeyNotFoundError ¶
IsKeyNotFoundError indicates whether the passed error is a key-value "Key Not Found" error.
func IsNetworkError ¶
IsNetworkError indicates whether the passed error is a network error.
func IsNoResultsError ¶
IsNoResultsError verifies whether or not the cause for an error is due no results being available to a query.
func IsPathExistsError ¶
IsPathExistsError indicates whether the passed error is a key-value "given path already exists in the document" error.
func IsPathNotFoundError ¶
IsPathNotFoundError indicates whether the passed error is a key-value "sub-document path does not exist" error.
func IsScopeMissingError ¶
IsScopeMissingError verifies whether or not the cause for an error is scope unknown
func IsServiceNotFoundError ¶
IsServiceNotFoundError indicates whether the passed error occurred due to the requested service not being found.
func IsSubdocPathExistsError ¶
IsSubdocPathExistsError verifies whether or not the cause for an error is due to a subdoc operation path exists
func IsSubdocPathNotFoundError ¶
IsSubdocPathNotFoundError verifies whether or not the cause for an error is due to a subdoc operation path not found.
func IsTempFailError ¶
IsTempFailError indicates whether the passed error is a key-value "temporary failure, try again later" error.
func IsTimeoutError ¶
IsTimeoutError verifies whether or not the cause for an error is a timeout.
func IsValueTooBigError ¶
IsValueTooBigError indicates whether the passed error is a key-value "document value was too large" error.
func JSONDecode ¶
JSONDecode applies JSON decoding behaviour to decode into a Go type. This function will ignore any flags passed to it, including compression. If a byte array is supplied as the out parameter then it will assign the raw bytes to it. For anything else it will apply JSON Unmarshal.
func JSONEncode ¶
JSONEncode applies JSON encoding to a Go type. For byte array data this will just return the value passed to it as bytes with flags set to JSON.
func LinearDelayFunction ¶
LinearDelayFunction provides retry delay durations (ms) following a linear increment pattern
func SetLogRedactionLevel ¶
func SetLogRedactionLevel(level LogRedactLevel)
SetLogRedactionLevel specifies the level with which logs should be redacted.
Types ¶
type AnalyticsDeferredResultHandle ¶
type AnalyticsDeferredResultHandle struct {
// contains filtered or unexported fields
}
AnalyticsDeferredResultHandle allows access to the handle of a deferred Analytics query.
Experimental: This API is subject to change at any time.
func (*AnalyticsDeferredResultHandle) Close ¶
func (r *AnalyticsDeferredResultHandle) Close() error
Close marks the results as closed, returning any errors that occurred during reading the results.
func (*AnalyticsDeferredResultHandle) Next ¶
func (r *AnalyticsDeferredResultHandle) Next(valuePtr interface{}) bool
Next assigns the next result from the results into the value pointer, returning whether the read was successful.
func (*AnalyticsDeferredResultHandle) NextBytes ¶
func (r *AnalyticsDeferredResultHandle) NextBytes() []byte
NextBytes returns the next result from the results as a byte array. TODO: how to deadline/timeout this?
func (*AnalyticsDeferredResultHandle) One ¶
func (r *AnalyticsDeferredResultHandle) One(valuePtr interface{}) error
One assigns the first value from the results into the value pointer.
func (*AnalyticsDeferredResultHandle) Status ¶
func (r *AnalyticsDeferredResultHandle) Status() (string, error)
Status triggers a network call to the handle URI, returning the current status of the long running query. TODO: how to deadline/timeout this?
type AnalyticsQueryError ¶
AnalyticsQueryError occurs for errors created by Couchbase Server during Analytics query execution.
type AnalyticsQueryErrors ¶
type AnalyticsQueryErrors interface {
error
Errors() []AnalyticsQueryError
HTTPStatus() int
Endpoint() string
ContextID() string
}
AnalyticsQueryErrors is a collection of one or more AnalyticsQueryError that occurs for errors created by Couchbase Server during Analytics query execution.
type AnalyticsQueryOptions ¶
type AnalyticsQueryOptions struct {
ServerSideTimeout time.Duration
// If Context is used then cancellation will only be applicable during initial http connect.
// If a timeout value is supplied with the context then that value will be propagated to the server
// and used to timeout the results stream.
Context context.Context
ParentSpanContext opentracing.SpanContext
Pretty bool
ContextID string
RawParam map[string]interface{}
Priority bool
PositionalParameters []interface{}
NamedParameters map[string]interface{}
// Experimental: This API is subject to change at any time.
Deferred bool
}
AnalyticsQueryOptions is the set of options available to an Analytics query.
type AnalyticsResultMetrics ¶
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 ¶
type AnalyticsResults struct {
// contains filtered or unexported fields
}
AnalyticsResults allows access to the results of an Analytics query.
func (*AnalyticsResults) Close ¶
func (r *AnalyticsResults) Close() error
Close marks the results as closed, returning any errors that occurred during reading the results.
func (*AnalyticsResults) Handle ¶
func (r *AnalyticsResults) Handle() *AnalyticsDeferredResultHandle
Handle returns a deferred result handle. This can be polled to verify whether the result is ready to be read.
Experimental: This API is subject to change at any time.
func (*AnalyticsResults) Metadata ¶
func (r *AnalyticsResults) Metadata() (*AnalyticsResultsMetadata, error)
Metadata returns metadata for this result.
func (*AnalyticsResults) Next ¶
func (r *AnalyticsResults) Next(valuePtr interface{}) bool
Next assigns the next result from the results into the value pointer, returning whether the read was successful.
func (*AnalyticsResults) NextBytes ¶
func (r *AnalyticsResults) NextBytes() []byte
NextBytes returns the next result from the results as a byte array.
func (*AnalyticsResults) One ¶
func (r *AnalyticsResults) One(valuePtr interface{}) error
One assigns the first value from the results into the value pointer. It will close the results but not before iterating through all remaining results, as such this should only be used for very small resultsets - ideally of, at most, length 1.
type AnalyticsResultsMetadata ¶
type AnalyticsResultsMetadata struct {
// contains filtered or unexported fields
}
AnalyticsResultsMetadata provides access to the metadata properties of an Analytics query result.
func (*AnalyticsResultsMetadata) ClientContextID ¶
func (r *AnalyticsResultsMetadata) ClientContextID() string
ClientContextID returns the context ID used for this query.
func (*AnalyticsResultsMetadata) Metrics ¶
func (r *AnalyticsResultsMetadata) Metrics() AnalyticsResultMetrics
Metrics returns metrics about execution of this result.
func (*AnalyticsResultsMetadata) RequestID ¶
func (r *AnalyticsResultsMetadata) RequestID() string
RequestID returns the request ID used for this query.
func (*AnalyticsResultsMetadata) Signature ¶
func (r *AnalyticsResultsMetadata) Signature() interface{}
Signature returns TODO
func (*AnalyticsResultsMetadata) Status ¶
func (r *AnalyticsResultsMetadata) Status() string
Status returns the status for the results.
func (*AnalyticsResultsMetadata) Warnings ¶
func (r *AnalyticsResultsMetadata) Warnings() []AnalyticsWarning
Warnings returns any warnings that occurred during query execution.
type AnalyticsWarning ¶
AnalyticsWarning represents any warning generating during the execution of an Analytics query.
type AppendOptions ¶
type AppendOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
DurabilityLevel DurabilityLevel
}
AppendOptions are the options available to the Append operation.
type AuthCredsRequest ¶
type AuthCredsRequest struct {
Service ServiceType
Endpoint string
Bucket string
}
AuthCredsRequest encapsulates the data for a credential request from the new Authenticator interface. UNCOMMITTED
type Authenticator ¶
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 BooleanFieldQuery ¶
type BooleanFieldQuery struct {
// contains filtered or unexported fields
}
BooleanFieldQuery represents a FTS boolean field query.
func NewBooleanFieldQuery ¶
func NewBooleanFieldQuery(val bool) *BooleanFieldQuery
NewBooleanFieldQuery creates a new BooleanFieldQuery.
func (*BooleanFieldQuery) Boost ¶
func (q *BooleanFieldQuery) Boost(boost float32) *BooleanFieldQuery
Boost specifies the boost for this query.
func (*BooleanFieldQuery) Field ¶
func (q *BooleanFieldQuery) Field(field string) *BooleanFieldQuery
Field specifies the field for this query.
func (BooleanFieldQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type BooleanQuery ¶
type BooleanQuery struct {
// contains filtered or unexported fields
}
BooleanQuery represents a FTS boolean query.
func NewBooleanQuery ¶
func NewBooleanQuery() *BooleanQuery
NewBooleanQuery creates a new BooleanQuery.
func (*BooleanQuery) Boost ¶
func (q *BooleanQuery) Boost(boost float32) *BooleanQuery
Boost specifies the boost for this query.
func (*BooleanQuery) MarshalJSON ¶
func (q *BooleanQuery) MarshalJSON() ([]byte, error)
MarshalJSON marshal's this query to JSON for the FTS REST API.
func (*BooleanQuery) Must ¶
func (q *BooleanQuery) Must(query FtsQuery) *BooleanQuery
Must specifies a query which must match.
func (*BooleanQuery) MustNot ¶
func (q *BooleanQuery) MustNot(query FtsQuery) *BooleanQuery
MustNot specifies a query which must not match.
func (*BooleanQuery) Should ¶
func (q *BooleanQuery) Should(query FtsQuery) *BooleanQuery
Should specifies a query which should match.
func (*BooleanQuery) ShouldMin ¶
func (q *BooleanQuery) ShouldMin(min int) *BooleanQuery
ShouldMin specifies the minimum value before the should query will boost.
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket represents a single bucket within a cluster.
func (*Bucket) Collection ¶
func (b *Bucket) Collection(scopeName string, collectionName string, opts *CollectionOptions) *Collection
Collection returns an instance of a collection.
func (*Bucket) DefaultCollection ¶
func (b *Bucket) DefaultCollection(opts *CollectionOptions) *Collection
DefaultCollection returns an instance of the default collection.
func (*Bucket) SpatialViewQuery ¶
func (b *Bucket) SpatialViewQuery(designDoc string, viewName string, opts *SpatialViewOptions) (*ViewResults, error)
SpatialViewQuery performs a spatial query and returns a list of rows or an error.
func (*Bucket) ViewQuery ¶
func (b *Bucket) ViewQuery(designDoc string, viewName string, opts *ViewOptions) (*ViewResults, error)
ViewQuery performs a view query and returns a list of rows or an error.
type BucketOptions ¶
type BucketOptions struct {
UseMutationTokens bool
}
BucketOptions are the options available when connecting to a Bucket.
type CertAuthenticator ¶
type CertAuthenticator struct {
}
CertAuthenticator implements an Authenticator which can be used with certificate authentication.
func (CertAuthenticator) Credentials ¶
func (ca CertAuthenticator) Credentials(req AuthCredsRequest) ([]UserPassPair, error)
Credentials returns the credentials for a particular service.
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster represents a connection to a specific Couchbase cluster.
func Connect ¶
func Connect(connStr string, opts ClusterOptions) (*Cluster, error)
Connect creates and returns a Cluster instance created using the provided options and connection string. The connection string properties are copied from (and should stay in sync with) the gocbcore agent.FromConnStr comment. Supported connSpecStr options are:
cacertpath (string) - Path to the CA certificate certpath (string) - Path to your authentication certificate keypath (string) - Path to your authentication key config_total_timeout (int) - Maximum period to attempt to connect to cluster in ms. config_node_timeout (int) - Maximum period to attempt to connect to a node in ms. http_redial_period (int) - Maximum period to keep HTTP config connections open in ms. http_retry_delay (int) - Period to wait between retrying nodes for HTTP config in ms. config_poll_floor_interval (int) - Minimum time to wait between fetching configs via CCCP in ms. config_poll_interval (int) - Period to wait between CCCP config polling in ms. kv_pool_size (int) - The number of connections to establish per node. max_queue_size (int) - The maximum size of the operation queues per node. use_kverrmaps (bool) - Whether to enable error maps from the server. use_enhanced_errors (bool) - Whether to enable enhanced error information. fetch_mutation_tokens (bool) - Whether to fetch mutation tokens for operations. compression (bool) - Whether to enable network-wise compression of documents. compression_min_size (int) - The minimal size of the document to consider compression. compression_min_ratio (float64) - The minimal compress ratio (compressed / original) for the document to be sent compressed. server_duration (bool) - Whether to enable fetching server operation durations. http_max_idle_conns (int) - Maximum number of idle http connections in the pool. http_max_idle_conns_per_host (int) - Maximum number of idle http connections in the pool per host. http_idle_conn_timeout (int) - Maximum length of time for an idle connection to stay in the pool in ms. network (string) - The network type to use. orphaned_response_logging (bool) - Whether to enable orphan response logging. orphaned_response_logging_interval (int) - How often to log orphan responses in ms. orphaned_response_logging_sample_size (int) - The number of samples to include in each orphaned response log. operation_tracing (bool) - Whether to enable tracing.
func (*Cluster) AnalyticsQuery ¶
func (c *Cluster) AnalyticsQuery(statement string, opts *AnalyticsQueryOptions) (*AnalyticsResults, error)
AnalyticsQuery performs an analytics query and returns a list of rows or an error.
func (*Cluster) Bucket ¶
func (c *Cluster) Bucket(bucketName string, opts *BucketOptions) *Bucket
Bucket connects the cluster to server(s) and returns a new Bucket instance.
func (*Cluster) Close ¶
func (c *Cluster) Close(opts *ClusterCloseOptions) error
Close shuts down all buckets in this cluster and invalidates any references this cluster has.
func (*Cluster) Query ¶
func (c *Cluster) Query(statement string, opts *QueryOptions) (*QueryResults, error)
Query executes the N1QL query statement on the server n1qlEp. This function assumes that `opts` already contains all the required settings. This function will inject any additional connection or request-level settings into the `opts` map (currently this is only the timeout).
func (*Cluster) SearchQuery ¶
func (c *Cluster) SearchQuery(q SearchQuery, opts *SearchQueryOptions) (*SearchResults, error)
SearchQuery performs a n1ql query and returns a list of rows or an error.
type ClusterCloseOptions ¶
type ClusterCloseOptions struct {
}
ClusterCloseOptions is the set of options available when disconnecting from a Cluster.
type ClusterOptions ¶
type ClusterOptions struct {
Authenticator Authenticator
ConnectTimeout time.Duration
KVTimeout time.Duration
ViewTimeout time.Duration
QueryTimeout time.Duration
AnalyticsTimeout time.Duration
SearchTimeout time.Duration
ManagementTimeout time.Duration
EnableTracing bool
}
ClusterOptions is the set of options available for creating a Cluster.
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection represents a single collection.
func (*Collection) Binary ¶
func (c *Collection) Binary() *CollectionBinary
Binary creates and returns a CollectionBinary object.
func (*Collection) Exists ¶
func (c *Collection) Exists(key string, opts *ExistsOptions) (docOut *ExistsResult, errOut error)
Exists checks if a document exists for the given key.
func (*Collection) Get ¶
func (c *Collection) Get(key string, opts *GetOptions) (docOut *GetResult, errOut error)
Get performs a fetch operation against the collection. This can take 3 paths, a standard full document fetch, a subdocument full document fetch also fetching document expiry (when WithExpiry is set), or a subdocument fetch (when Project is used).
func (*Collection) GetAllReplicas ¶
func (c *Collection) GetAllReplicas(key string, opts *GetFromReplicaOptions) (docOut *GetAllReplicasResult, errOut error)
GetAllReplicas returns the value of a particular document from all replica servers. This will return an iterable which streams results one at a time.
func (*Collection) GetAndLock ¶
func (c *Collection) GetAndLock(key string, expiration uint32, opts *GetAndLockOptions) (docOut *GetResult, errOut error)
GetAndLock locks a document for a period of time, providing exclusive RW access to it.
func (*Collection) GetAndTouch ¶
func (c *Collection) GetAndTouch(key string, expiration uint32, opts *GetAndTouchOptions) (docOut *GetResult, errOut error)
GetAndTouch retrieves a document and simultaneously updates its expiry time.
func (*Collection) GetAnyReplica ¶
func (c *Collection) GetAnyReplica(key string, opts *GetFromReplicaOptions) (docOut *GetReplicaResult, errOut error)
GetAnyReplica returns the value of a particular document from a replica server.
func (*Collection) Insert ¶
func (c *Collection) Insert(key string, val interface{}, opts *InsertOptions) (mutOut *MutationResult, errOut error)
Insert creates a new document in the Collection.
func (*Collection) LookupIn ¶
func (c *Collection) LookupIn(key string, ops []LookupInOp, opts *LookupInOptions) (docOut *LookupInResult, errOut error)
LookupIn performs a set of subdocument lookup operations on the document identified by key.
func (*Collection) MutateIn ¶
func (c *Collection) MutateIn(key string, ops []MutateInOp, opts *MutateInOptions) (mutOut *MutateInResult, errOut error)
MutateIn performs a set of subdocument mutations on the document specified by key.
func (*Collection) Remove ¶
func (c *Collection) Remove(key string, opts *RemoveOptions) (mutOut *MutationResult, errOut error)
Remove removes a document from the collection.
func (*Collection) Replace ¶
func (c *Collection) Replace(key string, val interface{}, opts *ReplaceOptions) (mutOut *MutationResult, errOut error)
Replace updates a document in the collection.
func (*Collection) Touch ¶
func (c *Collection) Touch(key string, expiration uint32, opts *TouchOptions) (mutOut *MutationResult, errOut error)
Touch touches a document, specifying a new expiry time for it.
func (*Collection) Unlock ¶
func (c *Collection) Unlock(key string, opts *UnlockOptions) (mutOut *MutationResult, errOut error)
Unlock unlocks a document which was locked with GetAndLock.
func (*Collection) Upsert ¶
func (c *Collection) Upsert(key string, val interface{}, opts *UpsertOptions) (mutOut *MutationResult, errOut error)
Upsert creates a new document in the Collection if it does not exist, if it does exist then it updates it.
type CollectionBinary ¶
type CollectionBinary struct {
*Collection
}
CollectionBinary is a set of binary operations.
func (*CollectionBinary) Append ¶
func (c *CollectionBinary) Append(key string, val []byte, opts *AppendOptions) (mutOut *MutationResult, errOut error)
Append appends a byte value to a document.
func (*CollectionBinary) Decrement ¶
func (c *CollectionBinary) Decrement(key string, opts *CounterOptions) (countOut *CounterResult, errOut error)
Decrement performs an atomic subtraction for an integer document. Passing a non-negative `initial` value will cause the document to be created if it did not already exist.
func (*CollectionBinary) Increment ¶
func (c *CollectionBinary) Increment(key string, opts *CounterOptions) (countOut *CounterResult, errOut error)
Increment performs an atomic addition for an integer document. Passing a non-negative `initial` value will cause the document to be created if it did not already exist.
func (*CollectionBinary) Prepend ¶
func (c *CollectionBinary) Prepend(key string, val []byte, opts *PrependOptions) (mutOut *MutationResult, errOut error)
Prepend prepends a byte value to a document.
type CollectionOptions ¶
type CollectionOptions struct {
ParentSpanContext opentracing.SpanContext
// Timeout specifies the amount of time to wait for the collection ID to be fetched.
Timeout time.Duration
Context context.Context
}
CollectionOptions are the options available when opening a collection.
type ConfigurationError ¶
ConfigurationError occurs when the client is configured incorrectly.
type ConjunctionQuery ¶
type ConjunctionQuery struct {
// contains filtered or unexported fields
}
ConjunctionQuery represents a FTS conjunction query.
func NewConjunctionQuery ¶
func NewConjunctionQuery(queries ...FtsQuery) *ConjunctionQuery
NewConjunctionQuery creates a new ConjunctionQuery.
func (*ConjunctionQuery) And ¶
func (q *ConjunctionQuery) And(queries ...FtsQuery) *ConjunctionQuery
And adds new predicate queries to this conjunction query.
func (*ConjunctionQuery) Boost ¶
func (q *ConjunctionQuery) Boost(boost float32) *ConjunctionQuery
Boost specifies the boost for this query.
func (ConjunctionQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type ConsistencyMode ¶
type ConsistencyMode int
ConsistencyMode indicates the level of data consistency desired for a query.
type CounterOptions ¶
type CounterOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
// Expiration is the length of time in seconds that the document will be stored in Couchbase.
// A value of 0 will set the document to never expire.
Expiration uint32
// Initial, if non-negative, is the `initial` value to use for the document if it does not exist.
// If present, this is the value that will be returned by a successful operation.
Initial int64
// Delta is the value to use for incrementing/decrementing if Initial is not present.
Delta uint64
DurabilityLevel DurabilityLevel
}
CounterOptions are the options available to the Counter operation.
type CounterResult ¶
type CounterResult struct {
MutationResult
// contains filtered or unexported fields
}
CounterResult is the return type of counter operations.
func (CounterResult) Cas ¶
func (mr CounterResult) Cas() Cas
Cas returns the Cas value for a document following an operation.
func (CounterResult) Content ¶
func (mr CounterResult) Content() uint64
Content returns the new value for the counter document.
func (CounterResult) MutationToken ¶
func (mr CounterResult) MutationToken() MutationToken
MutationToken returns the mutation token belonging to an operation.
type DateFacet ¶
type DateFacet struct {
// contains filtered or unexported fields
}
DateFacet is an FTS date range facet.
func NewDateFacet ¶
NewDateFacet creates a new date range facet.
func (DateFacet) MarshalJSON ¶
MarshalJSON marshal's this facet to JSON for the FTS REST API.
type DateRangeQuery ¶
type DateRangeQuery struct {
// contains filtered or unexported fields
}
DateRangeQuery represents a FTS date range query.
func NewDateRangeQuery ¶
func NewDateRangeQuery() *DateRangeQuery
NewDateRangeQuery creates a new DateRangeQuery.
func (*DateRangeQuery) Boost ¶
func (q *DateRangeQuery) Boost(boost float32) *DateRangeQuery
Boost specifies the boost for this query.
func (*DateRangeQuery) DateTimeParser ¶
func (q *DateRangeQuery) DateTimeParser(parser string) *DateRangeQuery
DateTimeParser specifies which date time string parser to use.
func (*DateRangeQuery) End ¶
func (q *DateRangeQuery) End(end string, inclusive bool) *DateRangeQuery
End specifies the end value and inclusiveness for this range query.
func (*DateRangeQuery) Field ¶
func (q *DateRangeQuery) Field(field string) *DateRangeQuery
Field specifies the field for this query.
func (DateRangeQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
func (*DateRangeQuery) Start ¶
func (q *DateRangeQuery) Start(start string, inclusive bool) *DateRangeQuery
Start specifies the start value and inclusiveness for this range query.
type DelayRetryBehavior ¶
type DelayRetryBehavior struct {
// contains filtered or unexported fields
}
DelayRetryBehavior provides the behavior to use when retrying queries with a backoff delay
func StandardDelayRetryBehavior ¶
func StandardDelayRetryBehavior(maxRetries uint, retryDelay uint, delayLimit time.Duration, delayFunc RetryDelayFunction) *DelayRetryBehavior
StandardDelayRetryBehavior provides a DelayRetryBehavior 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 (*DelayRetryBehavior) CanRetry ¶
func (rb *DelayRetryBehavior) CanRetry(retries uint) bool
CanRetry determines whether or not the query can be retried according to the behavior
func (*DelayRetryBehavior) NextInterval ¶
func (rb *DelayRetryBehavior) NextInterval(retries uint) time.Duration
NextInterval calculates what the next retry interval (ms) should be given how many retries there have been already
type DisjunctionQuery ¶
type DisjunctionQuery struct {
// contains filtered or unexported fields
}
DisjunctionQuery represents a FTS disjunction query.
func NewDisjunctionQuery ¶
func NewDisjunctionQuery(queries ...FtsQuery) *DisjunctionQuery
NewDisjunctionQuery creates a new DisjunctionQuery.
func (*DisjunctionQuery) Boost ¶
func (q *DisjunctionQuery) Boost(boost float32) *DisjunctionQuery
Boost specifies the boost for this query.
func (DisjunctionQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
func (*DisjunctionQuery) Or ¶
func (q *DisjunctionQuery) Or(queries ...FtsQuery) *DisjunctionQuery
Or adds new predicate queries to this disjunction query.
type DocIdQuery ¶
type DocIdQuery struct {
// contains filtered or unexported fields
}
DocIdQuery represents a FTS document id query.
func NewDocIdQuery ¶
func NewDocIdQuery(ids ...string) *DocIdQuery
NewDocIdQuery creates a new DocIdQuery.
func (*DocIdQuery) AddDocIds ¶
func (q *DocIdQuery) AddDocIds(ids ...string) *DocIdQuery
AddDocIds adds addition document ids to this query.
func (*DocIdQuery) Boost ¶
func (q *DocIdQuery) Boost(boost float32) *DocIdQuery
Boost specifies the boost for this query.
func (*DocIdQuery) Field ¶
func (q *DocIdQuery) Field(field string) *DocIdQuery
Field specifies the field for this query.
func (DocIdQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type DurabilityError ¶
type DurabilityError interface {
DurabilityError() bool
}
DurabilityError occurs when an error occurs during performing durability operations.
type DurabilityLevel ¶
type DurabilityLevel uint8
DurabilityLevel specifies the level of synchronous replication to use.
type ExistsOptions ¶
type ExistsOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
}
ExistsOptions are the options available to the Exists command.
type ExistsResult ¶
type ExistsResult struct {
Result
// contains filtered or unexported fields
}
ExistsResult is the return type of Exist operations.
func (*ExistsResult) Exists ¶
func (d *ExistsResult) Exists() bool
Exists returns whether or not the document exists.
type GeoBoundingBoxQuery ¶
type GeoBoundingBoxQuery struct {
// contains filtered or unexported fields
}
GeoBoundingBoxQuery represents a FTS geographical bounding box query.
func NewGeoBoundingBoxQuery ¶
func NewGeoBoundingBoxQuery(tlLat, tlLon, brLat, brLon float64) *GeoBoundingBoxQuery
NewGeoBoundingBoxQuery creates a new GeoBoundingBoxQuery.
func (*GeoBoundingBoxQuery) Boost ¶
func (q *GeoBoundingBoxQuery) Boost(boost float32) *GeoBoundingBoxQuery
Boost specifies the boost for this query.
func (*GeoBoundingBoxQuery) Field ¶
func (q *GeoBoundingBoxQuery) Field(field string) *GeoBoundingBoxQuery
Field specifies the field for this query.
func (GeoBoundingBoxQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type GeoDistanceQuery ¶
type GeoDistanceQuery struct {
// contains filtered or unexported fields
}
GeoDistanceQuery represents a FTS geographical distance query.
func NewGeoDistanceQuery ¶
func NewGeoDistanceQuery(lat, lon float64, distance string) *GeoDistanceQuery
NewGeoDistanceQuery creates a new GeoDistanceQuery.
func (*GeoDistanceQuery) Boost ¶
func (q *GeoDistanceQuery) Boost(boost float32) *GeoDistanceQuery
Boost specifies the boost for this query.
func (*GeoDistanceQuery) Field ¶
func (q *GeoDistanceQuery) Field(field string) *GeoDistanceQuery
Field specifies the field for this query.
func (GeoDistanceQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type GetAllReplicasResult ¶
type GetAllReplicasResult struct {
// contains filtered or unexported fields
}
GetAllReplicasResult is the return type of GetAllReplica operations.
func (*GetAllReplicasResult) Close ¶
func (r *GetAllReplicasResult) Close() error
Close ends the stream and returns any errors that occurred.
func (*GetAllReplicasResult) Next ¶
func (r *GetAllReplicasResult) Next(valuePtr *GetReplicaResult) bool
Next fetches the new replica.
type GetAndLockOptions ¶
type GetAndLockOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
}
GetAndLockOptions are the options available to the GetAndLock operation.
type GetAndTouchOptions ¶
type GetAndTouchOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
}
GetAndTouchOptions are the options available to the GetAndTouch operation.
type GetFromReplicaOptions ¶
type GetFromReplicaOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
}
GetFromReplicaOptions are the options available to the Get Replica commands.
type GetOptions ¶
type GetOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
WithExpiry bool
// Project causes the Get operation to only fetch the fields indicated
// by the paths. The result of the operation is then treated as a
// standard GetResult.
Project *ProjectOptions
}
GetOptions are the options available to a Get operation.
type GetReplicaResult ¶
type GetReplicaResult struct {
GetResult
// contains filtered or unexported fields
}
GetReplicaResult is the return type of GetReplica operations.
func (*GetReplicaResult) IsMaster ¶
func (r *GetReplicaResult) IsMaster() bool
IsMaster returns whether or not this result came from the active server.
type GetResult ¶
type GetResult struct {
Result
// contains filtered or unexported fields
}
GetResult is the return type of Get operations.
type HTTPError ¶
type HTTPError interface {
error
StatusCode() int
HTTPError() bool
// contains filtered or unexported methods
}
HTTPError occurs when there is a http error.
type IndexType ¶
type IndexType string
IndexType provides information on the type of indexer used for an index.
type InsertOptions ¶
type InsertOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
// The expiration length in seconds
Expiration uint32
PersistTo uint
ReplicateTo uint
DurabilityLevel DurabilityLevel
Encoder Encode
}
InsertOptions are options that can be applied to an Insert operation.
type KeyValueError ¶
type KeyValueError interface {
error
ID() string
StatusCode() int // ?
Opaque() uint32
KVError() bool
}
KeyValueError represents an error that occurred while executing a K/V operation. Assumes that the service has returned a response.
type LogRedactLevel ¶
type LogRedactLevel int
LogRedactLevel specifies the degree with which to redact the logs.
type Logger ¶
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 ¶
func DefaultStdioLogger() Logger
DefaultStdioLogger gets the default standard I/O logger.
gocb.SetLogger(gocb.DefaultStdioLogger())
func VerboseStdioLogger ¶
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 LookupInOp ¶
type LookupInOp struct {
// contains filtered or unexported fields
}
LookupInOp is the representation of an operation available when calling LookupIn
type LookupInOptions ¶
type LookupInOptions struct {
Context context.Context
Timeout time.Duration
ParentSpanContext opentracing.SpanContext
WithExpiry bool
}
LookupInOptions are the set of options available to LookupIn.
type LookupInResult ¶
type LookupInResult struct {
Result
// contains filtered or unexported fields
}
LookupInResult is the return type for LookupIn.
func (*LookupInResult) ContentAt ¶
func (lir *LookupInResult) ContentAt(idx int, valuePtr interface{}) error
ContentAt retrieves the value of the operation by its index. The index is the position of the operation as it was added to the builder.
func (*LookupInResult) DecodeAt ¶
func (lir *LookupInResult) DecodeAt(idx int, valuePtr interface{}, decode Decode) error
DecodeAt retrieves the value of the operation by its index. The index is the position of the operation as it was added to the builder. In order to decode the value it will use the support Decode function, by default it will use JSONDecode
func (*LookupInResult) Exists ¶
func (lir *LookupInResult) Exists(idx int) bool
Exists verifies that the item at idx exists.
type LookupInSpec ¶
type LookupInSpec struct {
}
LookupInSpec provides a way to create LookupInOps.
func (LookupInSpec) Count ¶
func (spec LookupInSpec) Count(path string, opts *LookupInSpecCountOptions) LookupInOp
Count allows you to retrieve the number of items in an array or keys within an dictionary within an element of a document.
func (LookupInSpec) Exists ¶
func (spec LookupInSpec) Exists(path string, opts *LookupInSpecExistsOptions) LookupInOp
Exists is similar to Path(), but does not actually retrieve the value from the server. This may save bandwidth if you only need to check for the existence of a path (without caring for its content). You can check the status of this operation by using .ContentAt (and ignoring the value) or .Exists() on the LookupResult.
func (LookupInSpec) Get ¶
func (spec LookupInSpec) Get(path string, opts *LookupInSpecGetOptions) LookupInOp
Get indicates a path to be retrieved from the document. The value of the path can later be retrieved from the LookupResult. The path syntax follows N1QL's path syntax (e.g. `foo.bar.baz`).
func (LookupInSpec) GetFull ¶
func (spec LookupInSpec) GetFull(opts *LookupInSpecGetFullOptions) LookupInOp
GetFull indicates that a full document should be retrieved. This command allows you to do things like combine with Get to fetch a document with certain Xattrs
type LookupInSpecCountOptions ¶
type LookupInSpecCountOptions struct {
IsXattr bool
}
LookupInSpecCountOptions are the options available to LookupIn subdoc Count operations.
type LookupInSpecExistsOptions ¶
type LookupInSpecExistsOptions struct {
IsXattr bool
}
LookupInSpecExistsOptions are the options available to LookupIn subdoc Exists operations.
type LookupInSpecGetFullOptions ¶
type LookupInSpecGetFullOptions struct {
}
LookupInSpecGetFullOptions are the options available to LookupIn subdoc GetFull operations. There are currently no options and this is left empty for future extensibility.
type LookupInSpecGetOptions ¶
type LookupInSpecGetOptions struct {
IsXattr bool
}
LookupInSpecGetOptions are the options available to LookupIn subdoc Get operations.
type MatchAllQuery ¶
type MatchAllQuery struct {
// contains filtered or unexported fields
}
MatchAllQuery represents a FTS match all query.
func NewMatchAllQuery ¶
func NewMatchAllQuery() *MatchAllQuery
NewMatchAllQuery creates a new MatchAllQuery.
func (MatchAllQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type MatchNoneQuery ¶
type MatchNoneQuery struct {
// contains filtered or unexported fields
}
MatchNoneQuery represents a FTS match none query.
func NewMatchNoneQuery ¶
func NewMatchNoneQuery() *MatchNoneQuery
NewMatchNoneQuery creates a new MatchNoneQuery.
func (MatchNoneQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type MatchPhraseQuery ¶
type MatchPhraseQuery struct {
// contains filtered or unexported fields
}
MatchPhraseQuery represents a FTS match phrase query.
func NewMatchPhraseQuery ¶
func NewMatchPhraseQuery(phrase string) *MatchPhraseQuery
NewMatchPhraseQuery creates a new MatchPhraseQuery
func (*MatchPhraseQuery) Analyzer ¶
func (q *MatchPhraseQuery) Analyzer(analyzer string) *MatchPhraseQuery
Analyzer specifies the analyzer to use for this query.
func (*MatchPhraseQuery) Boost ¶
func (q *MatchPhraseQuery) Boost(boost float32) *MatchPhraseQuery
Boost specifies the boost for this query.
func (*MatchPhraseQuery) Field ¶
func (q *MatchPhraseQuery) Field(field string) *MatchPhraseQuery
Field specifies the field for this query.
func (MatchPhraseQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type MatchQuery ¶
type MatchQuery struct {
// contains filtered or unexported fields
}
MatchQuery represents a FTS match query.
func NewMatchQuery ¶
func NewMatchQuery(match string) *MatchQuery
NewMatchQuery creates a new MatchQuery.
func (*MatchQuery) Analyzer ¶
func (q *MatchQuery) Analyzer(analyzer string) *MatchQuery
Analyzer specifies the analyzer to use for this query.
func (*MatchQuery) Boost ¶
func (q *MatchQuery) Boost(boost float32) *MatchQuery
Boost specifies the boost for this query.
func (*MatchQuery) Field ¶
func (q *MatchQuery) Field(field string) *MatchQuery
Field specifies the field for this query.
func (*MatchQuery) Fuzziness ¶
func (q *MatchQuery) Fuzziness(fuzziness int) *MatchQuery
Fuzziness specifies the fuziness for this query.
func (MatchQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
func (*MatchQuery) PrefixLength ¶
func (q *MatchQuery) PrefixLength(length int) *MatchQuery
PrefixLength specifies the prefix length from this query.
type MutateInOp ¶
type MutateInOp struct {
// contains filtered or unexported fields
}
MutateInOp is the representation of an operation available when calling MutateIn
type MutateInOptions ¶
type MutateInOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
Expiration uint32
Cas Cas
PersistTo uint
ReplicateTo uint
DurabilityLevel DurabilityLevel
InsertDocument bool
UpsertDocument bool
// Internal: This should never be used and is not supported.
AccessDeleted bool
}
MutateInOptions are the set of options available to MutateIn.
type MutateInResult ¶
type MutateInResult struct {
MutationResult
// contains filtered or unexported fields
}
MutateInResult is the return type of any mutate in related operations. It contains Cas, mutation tokens and any returned content.
func (MutateInResult) ContentAt ¶
func (mir MutateInResult) ContentAt(idx int, valuePtr interface{}) error
ContentAt retrieves the value of the operation by its index. The index is the position of the operation as it was added to the builder.
type MutateInSpec ¶
type MutateInSpec struct {
}
MutateInSpec provides a way to create MutateInOps.
func (MutateInSpec) ArrayAddUnique ¶
func (spec MutateInSpec) ArrayAddUnique(path string, val interface{}, opts *MutateInSpecArrayAddUniqueOptions) MutateInOp
ArrayAddUnique adds an dictionary add unique operation to this mutation operation set.
func (MutateInSpec) ArrayAppend ¶
func (spec MutateInSpec) ArrayAppend(path string, val interface{}, opts *MutateInSpecArrayAppendOptions) MutateInOp
ArrayAppend adds an element(s) to the end (i.e. right) of an array
func (MutateInSpec) ArrayInsert ¶
func (spec MutateInSpec) ArrayInsert(path string, val interface{}, opts *MutateInSpecArrayInsertOptions) MutateInOp
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 (MutateInSpec) ArrayPrepend ¶
func (spec MutateInSpec) ArrayPrepend(path string, val interface{}, opts *MutateInSpecArrayPrependOptions) MutateInOp
ArrayPrepend adds an element to the beginning (i.e. left) of an array
func (MutateInSpec) Decrement ¶
func (spec MutateInSpec) Decrement(path string, delta int64, opts *MutateInSpecCounterOptions) MutateInOp
Decrement adds a decrement operation to this mutation operation set.
func (MutateInSpec) Increment ¶
func (spec MutateInSpec) Increment(path string, delta int64, opts *MutateInSpecCounterOptions) MutateInOp
Increment adds an increment operation to this mutation operation set.
func (MutateInSpec) Insert ¶
func (spec MutateInSpec) Insert(path string, val interface{}, opts *MutateInSpecInsertOptions) MutateInOp
Insert inserts a value at the specified path within the document.
func (MutateInSpec) Remove ¶
func (spec MutateInSpec) Remove(path string, opts *MutateInSpecRemoveOptions) MutateInOp
Remove removes the field at path.
func (MutateInSpec) RemoveFull ¶
func (spec MutateInSpec) RemoveFull() (*MutateInOp, error)
RemoveFull removes the full document, including metadata.
func (MutateInSpec) Replace ¶
func (spec MutateInSpec) Replace(path string, val interface{}, opts *MutateInSpecReplaceOptions) MutateInOp
Replace replaces the value of the field at path.
func (MutateInSpec) Upsert ¶
func (spec MutateInSpec) Upsert(path string, val interface{}, opts *MutateInSpecUpsertOptions) MutateInOp
Upsert creates a new value at the specified path within the document if it does not exist, if it does exist then it updates it.
func (MutateInSpec) UpsertFull ¶
func (spec MutateInSpec) UpsertFull(val interface{}, opts *MutateInSpecUpsertFullOptions) MutateInOp
UpsertFull creates a new document if it does not exist, if it does exist then it updates it. This command allows you to do things like updating xattrs whilst upserting a document.
type MutateInSpecArrayAddUniqueOptions ¶
MutateInSpecArrayAddUniqueOptions are the options available to subdocument ArrayAddUnique operations.
type MutateInSpecArrayAppendOptions ¶
type MutateInSpecArrayAppendOptions struct {
CreatePath bool
IsXattr bool
// HasMultiple adds multiple values as elements to an array.
// When used `value` in the spec must be an array type
// ArrayAppend("path", []int{1,2,3,4}, MutateInSpecArrayAppendOptions{HasMultiple:true}) =>
// "path" [..., 1,2,3,4]
//
// This is a more efficient version (at both the network and server levels)
// of doing
// spec.ArrayAppend("path", 1, nil)
// spec.ArrayAppend("path", 2, nil)
// spec.ArrayAppend("path", 3, nil)
HasMultiple bool
Encoder Encode
}
MutateInSpecArrayAppendOptions are the options available to subdocument ArrayAppend operations.
type MutateInSpecArrayInsertOptions ¶
type MutateInSpecArrayInsertOptions struct {
CreatePath bool
IsXattr bool
// HasMultiple adds multiple values as elements to an array.
// When used `value` in the spec must be an array type
// ArrayInsert("path[1]", []int{1,2,3,4}, MutateInSpecArrayInsertOptions{HasMultiple:true}) =>
// "path" [..., 1,2,3,4]
//
// This is a more efficient version (at both the network and server levels)
// of doing
// spec.ArrayInsert("path[2]", 1, nil)
// spec.ArrayInsert("path[3]", 2, nil)
// spec.ArrayInsert("path[4]", 3, nil)
HasMultiple bool
Encoder Encode
}
MutateInSpecArrayInsertOptions are the options available to subdocument ArrayInsert operations.
type MutateInSpecArrayPrependOptions ¶
type MutateInSpecArrayPrependOptions struct {
CreatePath bool
IsXattr bool
// HasMultiple adds multiple values as elements to an array.
// When used `value` in the spec must be an array type
// ArrayPrepend("path", []int{1,2,3,4}, MutateInSpecArrayPrependOptions{HasMultiple:true}) =>
// "path" [1,2,3,4, ....]
//
// This is a more efficient version (at both the network and server levels)
// of doing
// spec.ArrayPrepend("path", 1, nil)
// spec.ArrayPrepend("path", 2, nil)
// spec.ArrayPrepend("path", 3, nil)
HasMultiple bool
Encoder Encode
}
MutateInSpecArrayPrependOptions are the options available to subdocument ArrayPrepend operations.
type MutateInSpecCounterOptions ¶
MutateInSpecCounterOptions are the options available to subdocument Increment and Decrement operations.
type MutateInSpecInsertOptions ¶
MutateInSpecInsertOptions are the options available to subdocument Insert operations.
type MutateInSpecRemoveOptions ¶
type MutateInSpecRemoveOptions struct {
IsXattr bool
}
MutateInSpecRemoveOptions are the options available to subdocument Remove operations.
type MutateInSpecReplaceOptions ¶
MutateInSpecReplaceOptions are the options available to subdocument Replace operations.
type MutateInSpecUpsertFullOptions ¶
type MutateInSpecUpsertFullOptions struct {
Encoder Encode
}
MutateInSpecUpsertFullOptions are the options available to subdocument UpsertFull operations.
type MutateInSpecUpsertOptions ¶
MutateInSpecUpsertOptions are the options available to subdocument Upsert operations.
type MutationMacro ¶
type MutationMacro string
MutationMacro can be supplied to MutateIn operations to perform ExpandMacros operations.
type MutationResult ¶
type MutationResult struct {
Result
// contains filtered or unexported fields
}
MutationResult is the return type of any store related operations. It contains Cas and mutation tokens.
func (MutationResult) MutationToken ¶
func (mr MutationResult) MutationToken() MutationToken
MutationToken returns the mutation token belonging to an operation.
type MutationState ¶
type MutationState struct {
// contains filtered or unexported fields
}
MutationState holds and aggregates MutationToken's across multiple operations.
func NewMutationState ¶
func NewMutationState(tokens ...MutationToken) *MutationState
NewMutationState creates a new MutationState for tracking mutation state.
func (*MutationState) Add ¶
func (mt *MutationState) Add(tokens ...MutationToken)
Add includes an operation's mutation information in this mutation state.
func (*MutationState) MarshalJSON ¶
func (mt *MutationState) MarshalJSON() ([]byte, error)
MarshalJSON marshal's this mutation state to JSON.
func (*MutationState) UnmarshalJSON ¶
func (mt *MutationState) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshal's a mutation state from JSON.
type MutationToken ¶
type MutationToken struct {
// contains filtered or unexported fields
}
MutationToken holds the mutation state information from an operation.
type NetworkError ¶
type NetworkError interface {
error
NetworkError() bool
// contains filtered or unexported methods
}
NetworkError occurs when there is a network error.
type NoResultsError ¶
NoResultsError occurs when when no results are available to a query.
type NodeManager ¶
type NodeManager struct {
}
NodeManager is used for management of nodes in the cluster.
type NumericFacet ¶
type NumericFacet struct {
// contains filtered or unexported fields
}
NumericFacet is an FTS numeric range facet.
func NewNumericFacet ¶
func NewNumericFacet(field string, size int) *NumericFacet
NewNumericFacet creates a new numeric range facet.
func (*NumericFacet) AddRange ¶
func (f *NumericFacet) AddRange(name string, start, end float64) *NumericFacet
AddRange adds a new range to this numeric range facet.
func (NumericFacet) MarshalJSON ¶
func (f NumericFacet) MarshalJSON() ([]byte, error)
MarshalJSON marshal's this facet to JSON for the FTS REST API.
type NumericRangeQuery ¶
type NumericRangeQuery struct {
// contains filtered or unexported fields
}
NumericRangeQuery represents a FTS numeric range query.
func NewNumericRangeQuery ¶
func NewNumericRangeQuery() *NumericRangeQuery
NewNumericRangeQuery creates a new NumericRangeQuery.
func (*NumericRangeQuery) Boost ¶
func (q *NumericRangeQuery) Boost(boost float32) *NumericRangeQuery
Boost specifies the boost for this query.
func (*NumericRangeQuery) Field ¶
func (q *NumericRangeQuery) Field(field string) *NumericRangeQuery
Field specifies the field for this query.
func (NumericRangeQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
func (*NumericRangeQuery) Max ¶
func (q *NumericRangeQuery) Max(max float32, inclusive bool) *NumericRangeQuery
Max specifies the maximum value and inclusiveness for this range query.
func (*NumericRangeQuery) Min ¶
func (q *NumericRangeQuery) Min(min float32, inclusive bool) *NumericRangeQuery
Min specifies the minimum value and inclusiveness for this range query.
type PasswordAuthenticator ¶
PasswordAuthenticator implements an Authenticator which uses an RBAC username and password.
func (PasswordAuthenticator) Credentials ¶
func (ra PasswordAuthenticator) Credentials(req AuthCredsRequest) ([]UserPassPair, error)
Credentials returns the credentials for a particular service.
type PhraseQuery ¶
type PhraseQuery struct {
// contains filtered or unexported fields
}
PhraseQuery represents a FTS phrase query.
func NewPhraseQuery ¶
func NewPhraseQuery(terms ...string) *PhraseQuery
NewPhraseQuery creates a new PhraseQuery.
func (*PhraseQuery) Boost ¶
func (q *PhraseQuery) Boost(boost float32) *PhraseQuery
Boost specifies the boost for this query.
func (*PhraseQuery) Field ¶
func (q *PhraseQuery) Field(field string) *PhraseQuery
Field specifies the field for this query.
func (PhraseQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type PrefixQuery ¶
type PrefixQuery struct {
// contains filtered or unexported fields
}
PrefixQuery represents a FTS prefix query.
func NewPrefixQuery ¶
func NewPrefixQuery(prefix string) *PrefixQuery
NewPrefixQuery creates a new PrefixQuery.
func (*PrefixQuery) Boost ¶
func (q *PrefixQuery) Boost(boost float32) *PrefixQuery
Boost specifies the boost for this query.
func (*PrefixQuery) Field ¶
func (q *PrefixQuery) Field(field string) *PrefixQuery
Field specifies the field for this query.
func (PrefixQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type PrependOptions ¶
type PrependOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
DurabilityLevel DurabilityLevel
}
PrependOptions are the options available to the Prepend operation.
type ProjectOptions ¶
ProjectOptions are the options for using projections as a part of a Get request.
type ProjectionErrors ¶
type ProjectionErrors interface {
error
Errors() []KeyValueError
ProjectionErrors() bool
}
ProjectionErrors is a collection of one or more KeyValueError that occurs during a Get with projections operation.
type QueryError ¶
QueryError occurs for errors created by Couchbase Server during N1ql query execution.
type QueryErrors ¶
type QueryErrors interface {
error
Errors() []QueryError
HTTPStatus() int
Endpoint() string
ContextID() string
}
QueryErrors is a collection of one or more QueryError that occurs for errors created by Couchbase Server during N1ql query execution.
type QueryOptions ¶
type QueryOptions struct {
Consistency ConsistencyMode
ConsistentWith *MutationState
Prepared bool
Profile QueryProfileType
// ScanCap specifies the maximum buffered channel size between the indexer
// client and the query service for index scans. This parameter controls
// when to use scan backfill. Use a negative number to disable.
ScanCap int
// PipelineBatch controls the number of items execution operators can
// batch for fetch from the KV node.
PipelineBatch int
// PipelineCap controls the maximum number of items each execution operator
// can buffer between various operators.
PipelineCap int
// ReadOnly controls whether a query can change a resulting recordset. If
// readonly is true, then only SELECT statements are permitted.
ReadOnly bool
ClientContextID string
Timeout time.Duration
PositionalParameters []interface{}
NamedParameters map[string]interface{}
// If Context is used then cancellation will only be applicable during initial http connect.
// If a timeout value is supplied with the context then that value will be propagated to the server
// and used to timeout the results stream.
Context context.Context
ParentSpanContext opentracing.SpanContext
// Custom allows specifying custom query options.
Custom map[string]interface{}
}
QueryOptions represents the options available when executing a N1QL query.
type QueryProfileType ¶
type QueryProfileType string
QueryProfileType specifies the profiling mode to use during a query.
type QueryResultMetrics ¶
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 ¶
type QueryResults struct {
// contains filtered or unexported fields
}
QueryResults allows access to the results of a N1QL query.
func (*QueryResults) Close ¶
func (r *QueryResults) Close() error
Close marks the results as closed, returning any errors that occurred during reading the results.
func (*QueryResults) Metadata ¶
func (r *QueryResults) Metadata() (*QueryResultsMetadata, error)
Metadata returns metadata for this result.
func (*QueryResults) Next ¶
func (r *QueryResults) Next(valuePtr interface{}) bool
Next assigns the next result from the results into the value pointer, returning whether the read was successful.
func (*QueryResults) NextBytes ¶
func (r *QueryResults) NextBytes() []byte
NextBytes returns the next result from the results as a byte array.
func (*QueryResults) One ¶
func (r *QueryResults) One(valuePtr interface{}) error
One assigns the first value from the results into the value pointer. It will close the results but not before iterating through all remaining results, as such this should only be used for very small resultsets - ideally of, at most, length 1.
type QueryResultsMetadata ¶
type QueryResultsMetadata struct {
// contains filtered or unexported fields
}
QueryResultsMetadata provides access to the metadata properties of a N1QL query result.
func (*QueryResultsMetadata) ClientContextID ¶
func (r *QueryResultsMetadata) ClientContextID() string
ClientContextID returns the context ID used for this query.
func (*QueryResultsMetadata) Metrics ¶
func (r *QueryResultsMetadata) Metrics() QueryResultMetrics
Metrics returns metrics about execution of this result.
func (*QueryResultsMetadata) RequestID ¶
func (r *QueryResultsMetadata) RequestID() string
RequestID returns the request ID used for this query.
func (*QueryResultsMetadata) Signature ¶
func (r *QueryResultsMetadata) Signature() interface{}
Signature returns the schema of the results.
func (*QueryResultsMetadata) SourceEndpoint ¶
func (r *QueryResultsMetadata) SourceEndpoint() string
SourceEndpoint returns the endpoint used for execution of this query. VOLATILE
func (*QueryResultsMetadata) Warnings ¶
func (r *QueryResultsMetadata) Warnings() []QueryWarning
Warnings returns any warnings that were generated during execution of the query.
type QueryStringQuery ¶
type QueryStringQuery struct {
// contains filtered or unexported fields
}
QueryStringQuery represents a FTS string query.
func NewQueryStringQuery ¶
func NewQueryStringQuery(query string) *QueryStringQuery
NewQueryStringQuery creates a new StringQuery.
func (*QueryStringQuery) Boost ¶
func (q *QueryStringQuery) Boost(boost float32) *QueryStringQuery
Boost specifies the boost for this query.
func (QueryStringQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type QueryWarning ¶
QueryWarning is the representation of any warnings that occurred during query execution.
type Range ¶
type Range struct {
Start interface{}
End interface{}
InclusiveEnd bool
}
Range specifies a value range to get results between.
type RegexpQuery ¶
type RegexpQuery struct {
// contains filtered or unexported fields
}
RegexpQuery represents a FTS regular expression query.
func NewRegexpQuery ¶
func NewRegexpQuery(regexp string) *RegexpQuery
NewRegexpQuery creates a new RegexpQuery.
func (*RegexpQuery) Boost ¶
func (q *RegexpQuery) Boost(boost float32) *RegexpQuery
Boost specifies the boost for this query.
func (*RegexpQuery) Field ¶
func (q *RegexpQuery) Field(field string) *RegexpQuery
Field specifies the field for this query.
func (RegexpQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type RemoveOptions ¶
type RemoveOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
Cas Cas
PersistTo uint
ReplicateTo uint
DurabilityLevel DurabilityLevel
}
RemoveOptions are the options available to the Remove command.
type ReplaceOptions ¶
type ReplaceOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
Expiration uint32
Cas Cas
PersistTo uint
ReplicateTo uint
DurabilityLevel DurabilityLevel
Encoder Encode
}
ReplaceOptions are the options available to a Replace operation.
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result is the base type for the return types of operations
func (*Result) Expiration ¶
Expiration returns the expiration value for the result.
func (*Result) HasExpiration ¶
HasExpiration verifies whether or not the result has an expiration value.
type RetryBehavior ¶
type RetryBehavior interface {
NextInterval(retries uint) time.Duration
CanRetry(retries uint) bool
}
RetryBehavior defines the behavior to be used for retries
type RetryDelayFunction ¶
RetryDelayFunction is called to get the next try delay
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
Scope represents a single scope within a bucket.
func (*Scope) Collection ¶
func (s *Scope) Collection(collectionName string, opts *CollectionOptions) *Collection
Collection returns an instance of a collection.
func (*Scope) DefaultCollection ¶
func (s *Scope) DefaultCollection(opts *CollectionOptions) *Collection
DefaultCollection returns an instance of the default collection.
type SearchError ¶
SearchError occurs for errors created by Couchbase Server during Search query execution.
type SearchErrors ¶
type SearchErrors interface {
error
Errors() []SearchError
HTTPStatus() int
Endpoint() string
ContextID() string
}
SearchErrors is a collection of one or more SearchError that occurs for errors created by Couchbase Server during Search query execution.
type SearchHighlightOptions ¶
type SearchHighlightOptions struct {
Style SearchHighlightStyle
Fields []string
}
SearchHighlightOptions are the options available for search highlighting.
type SearchHighlightStyle ¶
type SearchHighlightStyle string
SearchHighlightStyle indicates the type of highlighting to use for a search query.
type SearchQuery ¶
type SearchQuery struct {
Name string
Query interface{}
}
SearchQuery represents a pending search query.
type SearchQueryOptions ¶
type SearchQueryOptions struct {
Limit int
Skip int
Explain bool
Highlight *SearchHighlightOptions
Fields []string
Sort []interface{}
Facets map[string]interface{}
Timeout time.Duration
Consistency ConsistencyMode
ConsistentWith *MutationState
Context context.Context
ParentSpanContext opentracing.SpanContext
}
SearchQueryOptions represents a pending search query.
type SearchResultDateFacet ¶
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 ¶
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 ¶
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"`
Fields map[string]interface{} `json:"fields,omitempty"`
}
SearchResultHit holds a single hit in a list of search results.
type SearchResultLocation ¶
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 ¶
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 ¶
type SearchResultStatus struct {
Total int `json:"total,omitempty"`
Failed int `json:"failed,omitempty"`
Successful int `json:"successful,omitempty"`
}
SearchResultStatus holds the status information for an executed search query.
type SearchResultTermFacet ¶
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 ¶
type SearchResults struct {
// contains filtered or unexported fields
}
SearchResults allows access to the results of a search query.
func (*SearchResults) Close ¶
func (r *SearchResults) Close() error
Close marks the results as closed, returning any errors that occurred during reading the results.
func (SearchResults) Facets ¶
func (r SearchResults) Facets() (map[string]SearchResultFacet, error)
Facets contains the information relative to the facets requested in the search query.
func (*SearchResults) Metadata ¶
func (r *SearchResults) Metadata() (*SearchResultsMetadata, error)
Metadata returns metadata for this result.
func (*SearchResults) Next ¶
func (r *SearchResults) Next(hitPtr *SearchResultHit) bool
Next assigns the next result from the results into the value pointer, returning whether the read was successful.
func (*SearchResults) NextBytes ¶
func (r *SearchResults) NextBytes() []byte
NextBytes returns the next result from the results as a byte array.
func (*SearchResults) One ¶
func (r *SearchResults) One(hitPtr *SearchResultHit) error
One assigns the first value from the results into the value pointer. It will close the results but not before iterating through all remaining results, as such this should only be used for very small resultsets - ideally of, at most, length 1.
type SearchResultsMetadata ¶
type SearchResultsMetadata struct {
// contains filtered or unexported fields
}
SearchResultsMetadata provides access to the metadata properties of a search query result.
func (SearchResultsMetadata) ErrorCount ¶
func (r SearchResultsMetadata) ErrorCount() int
ErrorCount is the number of errors for the results.
func (SearchResultsMetadata) MaxScore ¶
func (r SearchResultsMetadata) MaxScore() float64
MaxScore returns the highest score of all documents for this query.
func (SearchResultsMetadata) SuccessCount ¶
func (r SearchResultsMetadata) SuccessCount() int
SuccessCount is the number of successes for the results.
func (SearchResultsMetadata) Took ¶
func (r SearchResultsMetadata) Took() time.Duration
Took returns the time taken to execute the search.
func (SearchResultsMetadata) TotalHits ¶
func (r SearchResultsMetadata) TotalHits() int
TotalHits is the actual number of hits before the limit was applied.
type SearchSortField ¶
type SearchSortField struct {
// contains filtered or unexported fields
}
SearchSortField represents a FTS field sort.
func NewSearchSortField ¶
func NewSearchSortField(field string) *SearchSortField
NewSearchSortField creates a new SearchSortField.
func (*SearchSortField) Descending ¶
func (q *SearchSortField) Descending(descending bool) *SearchSortField
Descending specifies the ordering of the results.
func (SearchSortField) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
func (*SearchSortField) Missing ¶
func (q *SearchSortField) Missing(missing string) *SearchSortField
Missing allows you to specify the FTS field sort missing behaviour.
func (*SearchSortField) Mode ¶
func (q *SearchSortField) Mode(mode string) *SearchSortField
Mode allows you to specify the FTS field sort mode.
func (*SearchSortField) Type ¶
func (q *SearchSortField) Type(value string) *SearchSortField
Type allows you to specify the FTS field sort type.
type SearchSortGeoDistance ¶
type SearchSortGeoDistance struct {
// contains filtered or unexported fields
}
SearchSortGeoDistance represents a FTS geo sort.
func NewSearchSortGeoDistance ¶
func NewSearchSortGeoDistance(field string, lat, lon float64) *SearchSortGeoDistance
NewSearchSortGeoDistance creates a new SearchSortGeoDistance.
func (*SearchSortGeoDistance) Descending ¶
func (q *SearchSortGeoDistance) Descending(descending bool) *SearchSortGeoDistance
Descending specifies the ordering of the results.
func (SearchSortGeoDistance) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
func (*SearchSortGeoDistance) Unit ¶
func (q *SearchSortGeoDistance) Unit(unit string) *SearchSortGeoDistance
Unit specifies the unit used for sorting
type SearchSortId ¶
type SearchSortId struct {
// contains filtered or unexported fields
}
SearchSortId represents a FTS Document ID sort.
func NewSearchSortId ¶
func NewSearchSortId() *SearchSortId
NewSearchSortId creates a new SearchSortScore.
func (*SearchSortId) Descending ¶
func (q *SearchSortId) Descending(descending bool) *SearchSortId
Descending specifies the ordering of the results.
func (SearchSortId) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type SearchSortScore ¶
type SearchSortScore struct {
// contains filtered or unexported fields
}
SearchSortScore represents a FTS score sort.
func NewSearchSortScore ¶
func NewSearchSortScore() *SearchSortScore
NewSearchSortScore creates a new SearchSortScore.
func (*SearchSortScore) Descending ¶
func (q *SearchSortScore) Descending(descending bool) *SearchSortScore
Descending specifies the ordering of the results.
func (SearchSortScore) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
type ServiceNotFoundError ¶
ServiceNotFoundError is a generic error for HTTP errors.
type ServiceType ¶
type ServiceType gocbcore.ServiceType
ServiceType specifies a particular Couchbase service type.
type SpatialViewOptions ¶
type SpatialViewOptions struct {
Stale StaleMode
Skip uint
Limit uint
// Bbox specifies the bounding region to use for the spatial query.
Bbox []float64
Development bool
Custom map[string]string
Context context.Context
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
}
SpatialViewOptions represents the options available when executing a spatial query.
type SubdocDocFlag ¶
type SubdocDocFlag gocbcore.SubdocDocFlag
SubdocDocFlag specifies document-level flags for a sub-document operation.
type SubdocFlag ¶
type SubdocFlag gocbcore.SubdocFlag
SubdocFlag provides special handling flags for sub-document operations
type TermFacet ¶
type TermFacet struct {
// contains filtered or unexported fields
}
TermFacet is an FTS term facet.
func NewTermFacet ¶
NewTermFacet creates a new TermFacet
func (TermFacet) MarshalJSON ¶
MarshalJSON marshal's this facet to JSON for the FTS REST API.
type TermQuery ¶
type TermQuery struct {
// contains filtered or unexported fields
}
TermQuery represents a FTS term query.
func (TermQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
func (*TermQuery) PrefixLength ¶
PrefixLength specifies the prefix length from this query.
type TermRangeQuery ¶
type TermRangeQuery struct {
// contains filtered or unexported fields
}
TermRangeQuery represents a FTS term range query.
func NewTermRangeQuery ¶
func NewTermRangeQuery(term string) *TermRangeQuery
NewTermRangeQuery creates a new TermRangeQuery.
func (*TermRangeQuery) Boost ¶
func (q *TermRangeQuery) Boost(boost float32) *TermRangeQuery
Boost specifies the boost for this query.
func (*TermRangeQuery) Field ¶
func (q *TermRangeQuery) Field(field string) *TermRangeQuery
Field specifies the field for this query.
func (TermRangeQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
func (*TermRangeQuery) Max ¶
func (q *TermRangeQuery) Max(max string, inclusive bool) *TermRangeQuery
Max specifies the maximum value and inclusiveness for this range query.
func (*TermRangeQuery) Min ¶
func (q *TermRangeQuery) Min(min string, inclusive bool) *TermRangeQuery
Min specifies the minimum value and inclusiveness for this range query.
type TimeoutError ¶ added in v2.1.1
type TimeoutError interface {
Timeout() bool
}
TimeoutError occurs when an operation times out.
type TouchOptions ¶
type TouchOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
DurabilityLevel DurabilityLevel
}
TouchOptions are the options available to the Touch operation.
type UnlockOptions ¶
type UnlockOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
Cas Cas
}
UnlockOptions are the options available to the GetAndLock operation.
type UpsertOptions ¶
type UpsertOptions struct {
ParentSpanContext opentracing.SpanContext
Timeout time.Duration
Context context.Context
// The expiration length in seconds
Expiration uint32
PersistTo uint
ReplicateTo uint
DurabilityLevel DurabilityLevel
Encoder Encode
}
UpsertOptions are options that can be applied to an Upsert operation.
type UserPassPair ¶
type UserPassPair gocbcore.UserPassPair
UserPassPair represents a username and password pair.
type ViewOptions ¶
type ViewOptions struct {
Stale StaleMode
Skip uint
Limit uint
Order SortOrder
Reduce bool
Group bool
GroupLevel uint
Key interface{}
Keys []interface{}
Range *Range
IDRangeStart string
IDRangeEnd string
Development bool
Custom map[string]string
Context context.Context
Timeout time.Duration
ParentSpanContext opentracing.SpanContext
}
ViewOptions represents the options available when executing view query.
type ViewQueryError ¶
ViewQueryError is the error type for an error that occurs during view query execution.
type ViewQueryErrors ¶
type ViewQueryErrors interface {
error
Errors() []ViewQueryError
HTTPStatus() int
Endpoint() string
}
ViewQueryErrors is a collection of one or more ViewQueryError that occurs for errors created by Couchbase Server during View query execution.
type ViewResults ¶
type ViewResults struct {
// contains filtered or unexported fields
}
ViewResults implements an iterator interface which can be used to iterate over the rows of the query results.
func (*ViewResults) Close ¶
func (r *ViewResults) Close() error
Close marks the results as closed, returning any errors that occurred during reading the results.
func (*ViewResults) Metadata ¶
func (r *ViewResults) Metadata() (*ViewResultsMetadata, error)
Metadata returns metadata for this result.
func (*ViewResults) Next ¶
func (r *ViewResults) Next(rowPtr *ViewRow) bool
Next assigns the next result from the results into the value pointer, returning whether the read was successful.
func (*ViewResults) NextBytes ¶
func (r *ViewResults) NextBytes() []byte
NextBytes returns the next result from the results as a byte array.
func (*ViewResults) One ¶
func (r *ViewResults) One(rowPtr *ViewRow) error
One assigns the first value from the results into the value pointer. It will close the results but not before iterating through all remaining results, as such this should only be used for very small resultsets - ideally of, at most, length 1.
type ViewResultsMetadata ¶
type ViewResultsMetadata struct {
// contains filtered or unexported fields
}
ViewResultsMetadata provides access to the metadata properties of a view query result.
func (*ViewResultsMetadata) TotalRows ¶
func (r *ViewResultsMetadata) TotalRows() int
TotalRows returns the total number of rows in the view, can be greater than the number of rows returned.
type ViewRow ¶
type ViewRow struct {
ID string
Key interface{}
Geometry interface{}
// contains filtered or unexported fields
}
ViewRow provides access to a single view query row.
type WildcardQuery ¶
type WildcardQuery struct {
// contains filtered or unexported fields
}
WildcardQuery represents a FTS wildcard query.
func NewWildcardQuery ¶
func NewWildcardQuery(wildcard string) *WildcardQuery
NewWildcardQuery creates a new WildcardQuery.
func (*WildcardQuery) Boost ¶
func (q *WildcardQuery) Boost(boost float32) *WildcardQuery
Boost specifies the boost for this query.
func (*WildcardQuery) Field ¶
func (q *WildcardQuery) Field(field string) *WildcardQuery
Field specifies the field for this query.
func (WildcardQuery) MarshalJSON ¶
MarshalJSON marshal's this query to JSON for the FTS REST API.
Source Files
¶
- analyticsquery_deferred.go
- analyticsquery_options.go
- auth.go
- bucket.go
- bucket_viewquery.go
- client.go
- cluster.go
- cluster_analyticsquery.go
- cluster_query.go
- cluster_searchquery.go
- collection.go
- collection_binary_crud.go
- collection_crud.go
- collection_dura.go
- collection_subdoc.go
- constants.go
- error.go
- jsontime.go
- logging.go
- nodemanager.go
- queryoptions.go
- results.go
- retrybehaviour.go
- scope.go
- searchquery.go
- searchquery_facet.go
- searchquery_options.go
- searchquery_sorting.go
- spatialquery_options.go
- stateblock.go
- token.go
- transcoding.go
- version.go
- viewquery_options.go
