rename gograph in graphdb

This commit is contained in:
Guillaume J. Charmes 2013-11-15 15:55:45 -08:00
parent 035c144242
commit cbd1281ec9
No known key found for this signature in database
GPG Key ID: B33E4642CB6E3FF3
8 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
package gograph
package graphdb
import (
"database/sql"

View File

@ -1,4 +1,4 @@
package gograph
package graphdb
import (
_ "code.google.com/p/gosqlite/sqlite3"

View File

@ -1,4 +1,4 @@
package gograph
package graphdb
import "sort"

View File

@ -1,4 +1,4 @@
package gograph
package graphdb
import (
"testing"

View File

@ -1,4 +1,4 @@
package gograph
package graphdb
import (
"path"

View File

@ -6,7 +6,7 @@ import (
"database/sql"
"fmt"
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/gograph"
"github.com/dotcloud/docker/graphdb"
"github.com/dotcloud/docker/graphdriver"
_ "github.com/dotcloud/docker/graphdriver/aufs"
_ "github.com/dotcloud/docker/graphdriver/devmapper"
@ -43,7 +43,7 @@ type Runtime struct {
volumes *Graph
srv *Server
config *DaemonConfig
containerGraph *gograph.Database
containerGraph *graphdb.Database
driver graphdriver.Driver
}
@ -581,7 +581,7 @@ func (runtime *Runtime) Children(name string) (map[string]*Container, error) {
}
children := make(map[string]*Container)
err = runtime.containerGraph.Walk(name, func(p string, e *gograph.Entity) error {
err = runtime.containerGraph.Walk(name, func(p string, e *graphdb.Entity) error {
c := runtime.Get(e.ID())
if c == nil {
return fmt.Errorf("Could not get container for name %s and id %s", e.ID(), p)
@ -659,20 +659,20 @@ func NewRuntimeFromDirectory(config *DaemonConfig) (*Runtime, error) {
return nil, err
}
gographPath := path.Join(config.Root, "linkgraph.db")
graphdbPath := path.Join(config.Root, "linkgraph.db")
initDatabase := false
if _, err := os.Stat(gographPath); err != nil {
if _, err := os.Stat(graphdbPath); err != nil {
if os.IsNotExist(err) {
initDatabase = true
} else {
return nil, err
}
}
conn, err := sql.Open("sqlite3", gographPath)
conn, err := sql.Open("sqlite3", graphdbPath)
if err != nil {
return nil, err
}
graph, err := gograph.NewDatabase(conn, initDatabase)
graph, err := graphdb.NewDatabase(conn, initDatabase)
if err != nil {
return nil, err
}

View File

@ -8,7 +8,7 @@ import (
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/auth"
"github.com/dotcloud/docker/engine"
"github.com/dotcloud/docker/gograph"
"github.com/dotcloud/docker/graphdb"
"github.com/dotcloud/docker/registry"
"github.com/dotcloud/docker/utils"
"io"
@ -502,7 +502,7 @@ func createAPIContainer(container *Container, size bool, runtime *Runtime) APICo
ID: container.ID,
}
names := []string{}
runtime.containerGraph.Walk("/", func(p string, e *gograph.Entity) error {
runtime.containerGraph.Walk("/", func(p string, e *graphdb.Entity) error {
if e.ID() == container.ID {
names = append(names, p)
}