Documentation
¶
Overview ¶
Package storage provides the底层 storage layer for gograph using Pebble as the underlying key-value store. It handles data marshaling, key generation, and basic CRUD operations.
Package storage provides the底层 storage layer for gograph using Pebble as the underlying key-value store.
Index ¶
- Constants
- func AdjKey(nodeID, relType, direction, relID string) []byte
- func AdjKeyPrefix(nodeID string) []byte
- func AdjKeyPrefixNodeAndType(nodeID, relType string) []byte
- func AdjKeyPrefixNodeAndTypeAndDir(nodeID, relType, direction string) []byte
- func LabelKey(labelName, nodeID string) []byte
- func LabelKeyPrefix(labelName string) []byte
- func Marshal(v interface{}) ([]byte, error)
- func NodeKey(nodeID string) []byte
- func PropertyKey(labelName, propName, propValue string) []byte
- func PropertyKeyPrefix(labelName, propName string) []byte
- func RelKey(relID string) []byte
- func Unmarshal(data []byte, v interface{}) error
- type Batch
- type DB
- func (db *DB) Close() error
- func (db *DB) Delete(key []byte) error
- func (db *DB) DumpAll() (map[string][]byte, error)
- func (db *DB) Get(key []byte) ([]byte, error)
- func (db *DB) NewBatch() *Batch
- func (db *DB) NewIter(opts *pebble.IterOptions) (*Iterator, error)
- func (db *DB) Put(key, value []byte) error
- type Iterator
- func (i *Iterator) Close() error
- func (i *Iterator) Error() error
- func (i *Iterator) Key() []byte
- func (i *Iterator) Next() bool
- func (i *Iterator) Prev() bool
- func (i *Iterator) SeekGE(key []byte) bool
- func (i *Iterator) SeekLT(key []byte) bool
- func (i *Iterator) Valid() bool
- func (i *Iterator) Value() []byte
Constants ¶
const ( KeyPrefixNode = "node:" KeyPrefixRel = "rel:" KeyPrefixLabel = "label:" KeyPrefixProp = "prop:" KeyPrefixAdj = "adj:" KeyPrefixMeta = "meta:" KeyPrefixIndexCount = "meta:index_count" )
Variables ¶
This section is empty.
Functions ¶
func AdjKeyPrefix ¶
AdjKeyPrefix returns the key prefix for all adjacency entries of a node.
func AdjKeyPrefixNodeAndType ¶
AdjKeyPrefixNodeAndType returns the key prefix for all adjacency entries of a node with a specific relationship type.
func AdjKeyPrefixNodeAndTypeAndDir ¶
AdjKeyPrefixNodeAndTypeAndDir returns the key prefix for all adjacency entries of a node with a specific relationship type and direction.
func LabelKeyPrefix ¶
LabelKeyPrefix returns the key prefix for all entries with the given label.
func PropertyKey ¶
PropertyKey returns the storage key for a property index entry.
func PropertyKeyPrefix ¶
PropertyKeyPrefix returns the key prefix for all entries with the given label and property name.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}