package graphdb
import "github.com/docker/docker/pkg/graphdb"
Index ¶
- func IsNonUniqueNameError(err error) bool
- func PathDepth(p string) int
- type Database
- func NewDatabase(conn *sql.DB, init bool) (*Database, error)
- func NewSqliteConn(root string) (*Database, error)
- 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) 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
Functions ¶
func IsNonUniqueNameError ¶
func PathDepth ¶
Returns the depth or number of / in a given path
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) Children ¶
Return the children of the specified entity
func (*Database) Close ¶
Close the underlying connection to the database
func (*Database) Delete ¶
Delete the reference to an entity at a given path
func (*Database) Exists ¶
Return true if a name already exists in the database
func (*Database) Get ¶
Return the entity for a given path
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) RefPaths ¶
Return all the id's path references
func (*Database) Refs ¶
Return the refrence count for a specified id
func (*Database) Rename ¶
Rename an edge for a given path
func (*Database) RootEntity ¶
Return the root "/" entity for the database
func (*Database) Set ¶
Set the entity id for a given path
func (*Database) Walk ¶
Walk through the child graph of an entity, calling walkFunc for each child entity. It is safe for walkFunc to call graph functions.
type Edge ¶
An Edge connects two entities together
type Edges ¶
type Edges []*Edge
type Entities ¶
func (Entities) Paths ¶
Return the paths sorted by depth
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
Entity with a unique id
func (*Entity) ID ¶
Return the id used to reference this entity
type WalkFunc ¶
type WalkMeta ¶
Source Files ¶
conn_sqlite3.go graphdb.go sort.go utils.go
- Version
- v0.12.0
- Published
- Jun 6, 2014
- Platform
- js/wasm
- Imports
- 8 packages
- Last checked
- 3 minutes ago –
Tools for package owners.