Documentation
¶
Overview ¶
Package paths encodes and decodes storage paths for database objects.
Index ¶
- func CollectionInfo(prefix string) string
- func CollectionsPrefix(prefix string) string
- func FromCollection(prefix string, name []byte) string
- func FromKey(prefix string, key []byte) string
- func FromTransaction(prefix string, id data.TxID) string
- func IsCollectionInfo(p string) bool
- func KeysPrefix(prefix string) string
- func ToCollection(suffix string) ([]byte, error)
- func ToKey(suffix string) ([]byte, error)
- func ToTransaction(suffix string) (data.TxID, error)
- type ParseResult
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectionInfo ¶
CollectionInfo returns the storage path for the collection info object under the given prefix.
func CollectionsPrefix ¶
CollectionsPrefix returns the storage path prefix for listing all collections under the given prefix.
func FromCollection ¶
FromCollection encodes a collection name into a storage path under the given prefix.
func FromTransaction ¶
FromTransaction encodes a transaction ID into a storage path under the given prefix.
func IsCollectionInfo ¶
IsCollectionInfo reports whether the given path refers to a collection info object.
func KeysPrefix ¶
KeysPrefix returns the storage path prefix for listing all keys under the given prefix.
func ToCollection ¶
ToCollection decodes a collection name from its storage path suffix.
Types ¶
type ParseResult ¶
ParseResult holds the components of a parsed storage path.
func Parse ¶
func Parse(p string) (ParseResult, error)
Parse splits a storage path into its prefix, type, and suffix components.