docs, signatures; glog for main; config.New()

This commit is contained in:
Jimmy Zelinskie
2014-06-24 03:59:30 -04:00
parent 3c01900c69
commit 42693e2a3b
11 changed files with 125 additions and 115 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ var drivers = make(map[string]Driver)
// Driver represents an interface to a long-running connection with a
// consistent data store.
type Driver interface {
New(*config.DataStore) Conn
New(*config.DriverConfig) Conn
}
// Register makes a database driver available by the provided name.
@@ -36,7 +36,7 @@ func Register(name string, driver Driver) {
}
// Open creates a connection specified by a models configuration.
func Open(conf *config.DataStore) (Conn, error) {
func Open(conf *config.DriverConfig) (Conn, error) {
driver, ok := drivers[conf.Driver]
if !ok {
return nil, fmt.Errorf(
+1 -1
View File
@@ -24,7 +24,7 @@ type Mock struct {
deltaHistoryM sync.RWMutex
}
func (d *driver) New(conf *config.DataStore) backend.Conn {
func (d *driver) New(conf *config.DriverConfig) backend.Conn {
return &Mock{}
}
+1 -1
View File
@@ -15,7 +15,7 @@ import (
type driver struct{}
func (d *driver) New(conf *config.DataStore) tracker.Pool {
func (d *driver) New(conf *config.DriverConfig) tracker.Pool {
return &Pool{
users: make(map[string]*models.User),
torrents: make(map[string]*models.Torrent),
+2 -2
View File
@@ -30,7 +30,7 @@ var (
// Driver represents an interface to pool of connections to models used for
// the tracker.
type Driver interface {
New(*config.DataStore) Pool
New(*config.DriverConfig) Pool
}
// Register makes a database driver available by the provided name.
@@ -47,7 +47,7 @@ func Register(name string, driver Driver) {
}
// Open creates a pool of data store connections specified by a models configuration.
func Open(conf *config.DataStore) (Pool, error) {
func Open(conf *config.DriverConfig) (Pool, error) {
driver, ok := drivers[conf.Driver]
if !ok {
return nil, fmt.Errorf(