Documentation
¶
Index ¶
- Constants
- func FirstKeyPart(key string) string
- func IsRowKey(key string) bool
- func JoinBatchHandle(batchType BatchType, batchId uint64) wire.BatchHandle
- func JoinKeyParts(parts ...string) string
- func ParseRowKey(key string) (collection wire.Id, row string, err error)
- func ParseRowKeyOrDie(key string) (collection wire.Id, row string)
- func ScanPrefixArgs(stKeyPrefix, prefix string) ([]byte, []byte)
- func ScanRangeArgs(stKeyPrefix, start, limit string) ([]byte, []byte)
- func SplitKeyParts(key string) []string
- func SplitNKeyParts(key string, n int) []string
- func StripFirstKeyPartOrDie(key string) string
- type BatchType
Constants ¶
const ( AppPrefix = "a" CollectionPermsPrefix = "c" DatabasePrefix = "d" DbGCPrefix = "g" DbInfoPrefix = "i" LogPrefix = "l" VClockPrefix = "q" RowPrefix = "r" ServicePrefix = "s" VersionPrefix = "v" SyncPrefix = "y" // KeyPartSep is a separator for parts of storage engine keys, e.g. separating // collection id from row key. KeyPartSep = "\xfe" // PrefixRangeLimitSuffix is a key suffix that indicates the end of a prefix // range. Must be greater than any character allowed in client-specified keys. PrefixRangeLimitSuffix = "\xff" // AppDir is the filesystem directory that holds all app databases. AppDir = "apps" // DbDir is the filesystem directory that holds all databases for an app. DbDir = "dbs" )
Constants related to storage engine keys. Note, these are persisted and therefore must not be modified.
const ( // The pool.ntp.org project is a big virtual cluster of timeservers providing // reliable easy to use NTP service for millions of clients. // For more information, see: http://www.pool.ntp.org/en/ NtpDefaultHost = "pool.ntp.org:123" )
Other constants.
const ( // Object name component for Syncbase-to-Syncbase (sync) RPCs. // Sync object names have the form: // <syncbase>/%%sync/... SyncbaseSuffix = "%%sync" )
Constants related to object names.
Variables ¶
This section is empty.
Functions ¶
func FirstKeyPart ¶
FirstKeyPart returns the first part of 'key', typically a key prefix defined in constants.go.
func JoinBatchHandle ¶
func JoinBatchHandle(batchType BatchType, batchId uint64) wire.BatchHandle
JoinBatchHandle encodes batch type and id into a BatchHandle.
func JoinKeyParts ¶
JoinKeyParts builds keys for accessing data in the storage engine.
func ParseRowKey ¶
ParseRowKey extracts collection and row parts from the given storage engine key for a data row. Returns an error if the given key is not a storage engine key for a data row.
func ParseRowKeyOrDie ¶
ParseRowKeyOrDie calls ParseRowKey and panics on error.
func ScanPrefixArgs ¶
ScanPrefixArgs returns args for sn.Scan() for the specified prefix.
func ScanRangeArgs ¶
ScanRangeArgs returns args for sn.Scan() for the specified range. If limit is "", all rows with keys >= start are included.
func SplitKeyParts ¶
SplitKeyParts is the inverse of JoinKeyParts. Clients are generally encouraged to use SplitNKeyParts.
func SplitNKeyParts ¶
SplitNKeyParts is to SplitKeyParts as strings.SplitN is to strings.Split.
func StripFirstKeyPartOrDie ¶
StripFirstKeyPartOrDie strips off the first part of the given key. Typically used to strip off the key prefixes defined in constants.go. Panics if the input string has fewer than two parts.