mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-30 11:08:10 -07:00
Separate tracker logic from the http package, step 1
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/chihaya/chihaya/config"
|
||||
"github.com/chihaya/chihaya/models"
|
||||
"github.com/chihaya/chihaya/tracker/models"
|
||||
)
|
||||
|
||||
var drivers = make(map[string]Driver)
|
||||
@@ -35,7 +35,7 @@ func Register(name string, driver Driver) {
|
||||
drivers[name] = driver
|
||||
}
|
||||
|
||||
// Open creates a connection specified by a models configuration.
|
||||
// Open creates a connection specified by a configuration.
|
||||
func Open(cfg *config.DriverConfig) (Conn, error) {
|
||||
driver, ok := drivers[cfg.Name]
|
||||
if !ok {
|
||||
|
||||
@@ -9,7 +9,7 @@ package noop
|
||||
import (
|
||||
"github.com/chihaya/chihaya/config"
|
||||
"github.com/chihaya/chihaya/drivers/backend"
|
||||
"github.com/chihaya/chihaya/models"
|
||||
"github.com/chihaya/chihaya/tracker/models"
|
||||
)
|
||||
|
||||
type driver struct{}
|
||||
|
||||
Reference in New Issue
Block a user