mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-15 12:58:10 -07:00
initial storage reorganization
This commit is contained in:
+4
-4
@@ -17,15 +17,15 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/pushrax/chihaya/cache"
|
||||
"github.com/pushrax/chihaya/config"
|
||||
"github.com/pushrax/chihaya/models"
|
||||
"github.com/pushrax/chihaya/storage/tracker"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
conf *config.Config
|
||||
listener net.Listener
|
||||
dbConnPool cache.Pool
|
||||
dbConnPool tracker.Pool
|
||||
|
||||
serving bool
|
||||
startTime time.Time
|
||||
@@ -41,7 +41,7 @@ type Server struct {
|
||||
}
|
||||
|
||||
func New(conf *config.Config) (*Server, error) {
|
||||
pool, err := cache.Open(&conf.Cache)
|
||||
pool, err := tracker.Open(&conf.Cache)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -133,7 +133,7 @@ func fail(err error, w http.ResponseWriter, r *http.Request) {
|
||||
w.(http.Flusher).Flush()
|
||||
}
|
||||
|
||||
func validateUser(tx cache.Tx, dir string) (*models.User, error) {
|
||||
func validateUser(tx tracker.Conn, dir string) (*models.User, error) {
|
||||
if len(dir) != 34 {
|
||||
return nil, errors.New("Passkey is invalid")
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
|
||||
"github.com/pushrax/chihaya/config"
|
||||
|
||||
_ "github.com/pushrax/chihaya/cache/redis"
|
||||
_ "github.com/pushrax/chihaya/storage/batter"
|
||||
_ "github.com/pushrax/chihaya/storage/tracker/redis"
|
||||
_ "github.com/pushrax/chihaya/storage/web/batter"
|
||||
)
|
||||
|
||||
func newTestServer() (*Server, error) {
|
||||
|
||||
Reference in New Issue
Block a user