Documentation ¶
Index ¶
- func IsNonUniqueNameError(err error) bool
- func PathDepth(p string) int
- type Database
- func (db *Database) Children(name string, depth int) ([]WalkMeta, error)
- func (db *Database) Close() error
- func (db *Database) Delete(name string) error
- func (db *Database) Exists(name string) bool
- func (db *Database) Get(name string) *Entity
- func (db *Database) List(name string, depth int) Entities
- func (db *Database) Parents(name string) ([]string, error)
- func (db *Database) Purge(id string) (int, error)
- func (db *Database) RefPaths(id string) Edges
- func (db *Database) Refs(id string) int
- func (db *Database) Rename(currentName, newName string) error
- func (db *Database) RootEntity() *Entity
- func (db *Database) Set(fullPath, id string) (*Entity, error)
- func (db *Database) Walk(name string, walkFunc WalkFunc, depth int) error
- type Edge
- type Edges
- type Entities
- type Entity
- type WalkFunc
- type WalkMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNonUniqueNameError ¶
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Graph database for storing entities and their relationships
func NewDatabase ¶
Create a new graph database initialized with a root entity
func NewSqliteConn ¶
func (*Database) List ¶
List all entities by from the name The key will be the full path of the entity
func (*Database) Purge ¶
Remove the entity with the specified id Walk the graph to make sure all references to the entity are removed and return the number of references removed
func (*Database) RootEntity ¶
Return the root "/" entity for the database
Click to show internal directories.
Click to hide internal directories.