Documentation ¶
Overview ¶
Package catalog provides a common catalog abstraction over all storage engines, such as Couchbase server, cloud, mobile, file, 3rd-party databases and storage engines, etc.
Index ¶
- Constants
- type Bin
- type Bucket
- type CountIndex
- type Direction
- type EntryChannel
- type ExistenceIndex
- type Index
- type IndexEntry
- type IndexKey
- type IndexType
- type LookupIndex
- type LookupValue
- type Pool
- type PrimaryIndex
- type RangeInclusion
- type RangeIndex
- type RangeStatistics
- type ScanIndex
- type SearchIndex
- type Site
Constants ¶
const CHANNEL = "CATALOG"
log channel for the catalog lifecycle
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bin ¶
type Bin interface { Count() (int64, query.Error) Min() (dparval.Value, query.Error) Max() (dparval.Value, query.Error) DistinctCount(int64, query.Error) }
Bin represents a range bin within IndexStatistics.
type Bucket ¶
type Bucket interface { PoolId() string Id() string Name() string Count() (int64, query.Error) IndexIds() ([]string, query.Error) IndexNames() ([]string, query.Error) IndexById(id string) (Index, query.Error) IndexByName(name string) (Index, query.Error) IndexByPrimary() (PrimaryIndex, query.Error) // Returns the server-recommended primary index IndexesByPrimary() ([]PrimaryIndex, query.Error) // Returns all available primary indexes Indexes() ([]Index, query.Error) Fetch(id string) (*dparval.Value, query.Error) BulkFetch([]string) (map[string]*dparval.Value, query.Error) Release() CreatePrimaryIndex() (PrimaryIndex, query.Error) CreateIndex(name string, key IndexKey, using IndexType) (Index, query.Error) }
Bucket is a collection of key-value entries (typically key-document, but not always).
type CountIndex ¶ added in v0.6.0
CountIndex represents indexes that can efficiently produce entry counts.
type Direction ¶
type Direction int
Direction represents ASC and DESC TODO: Is this needed?
const ( ASC Direction = 1 DESC = 2 )
type EntryChannel ¶ added in v0.6.0
type EntryChannel chan *IndexEntry
type ExistenceIndex ¶
type ExistenceIndex interface {
Check(value LookupValue, ch EntryChannel, warnch, errch query.ErrorChannel)
}
ExistenceIndex represents existence indexes.
type Index ¶
type Index interface { BucketId() string Id() string Name() string Type() IndexType IsPrimary() bool Key() IndexKey Drop() query.Error // PrimaryIndexes cannot be dropped }
Index is the base type for all indexes.
type IndexEntry ¶ added in v0.6.0
type IndexEntry struct { EntryKey LookupValue PrimaryKey string }
type IndexKey ¶
type IndexKey []ast.Expression
type LookupIndex ¶
type LookupIndex interface { ExistenceIndex Lookup(value LookupValue, ch EntryChannel, warnch, errch query.ErrorChannel) }
LookupIndex represents lookup indexes.
type LookupValue ¶
type Pool ¶
type Pool interface { SiteId() string Id() string Name() string BucketIds() ([]string, query.Error) BucketNames() ([]string, query.Error) BucketById(name string) (Bucket, query.Error) BucketByName(name string) (Bucket, query.Error) }
Pool represents a logical authentication, query, and resource allocation boundary, as well as a grouping of buckets.
type PrimaryIndex ¶
type PrimaryIndex interface { Index ScanIndex ScanBucket(limit int64, ch EntryChannel, warnch, errch query.ErrorChannel) }
PrimaryIndex represents primary key indexes.
type RangeInclusion ¶
type RangeInclusion int
Inclusion controls how the boundaries values of a range are treated
const ( Neither RangeInclusion = iota Low High Both )
type RangeIndex ¶
type RangeIndex interface { Index ScanIndex LookupIndex Direction() Direction Statistics() (RangeStatistics, query.Error) ScanRange(low LookupValue, high LookupValue, inclusion RangeInclusion, limit int64, ch EntryChannel, warnch, errch query.ErrorChannel) }
RangeIndex represents range scan indexes.
type RangeStatistics ¶
type RangeStatistics interface { Count() (int64, query.Error) Min() (dparval.Value, query.Error) Max() (dparval.Value, query.Error) DistinctCount(int64, query.Error) Bins() ([]Bin, query.Error) }
RangeStatistics captures statistics for a range index.
type ScanIndex ¶
type ScanIndex interface {
ScanEntries(limit int64, ch EntryChannel, warnch, errch query.ErrorChannel)
}
ScanIndex represents scanning indexes.
type SearchIndex ¶
type SearchIndex interface { Index SearchValue(value string, limit int64, ch EntryChannel, warnch, errch query.ErrorChannel) }
SearchIndex represents full text search indexes.
Directories ¶
Path | Synopsis |
---|---|
Package file provides a file-based implementation of the catalog package.
|
Package file provides a file-based implementation of the catalog package. |
Package mock provides a fake, mock 100%-in-memory implementation of the catalog package, which can be useful for testing.
|
Package mock provides a fake, mock 100%-in-memory implementation of the catalog package, which can be useful for testing. |