overhaul everything

This commit is contained in:
Jimmy Zelinskie
2014-06-23 22:47:43 -04:00
parent 18f6c32d97
commit 3bfb3074b4
27 changed files with 1193 additions and 1143 deletions

View File

@@ -0,0 +1,28 @@
// Copyright 2013 The Chihaya Authors. All rights reserved.
// Use of this source code is governed by the BSD 2-Clause license,
// which can be found in the LICENSE file.
// Package mock implements the models interface for a BitTorrent tracker
// within memory. It can be used in production, but isn't recommended.
// Stored values will not persist if the tracker is restarted.
package mock
import (
"github.com/chihaya/chihaya/config"
"github.com/chihaya/chihaya/drivers/tracker"
"github.com/chihaya/chihaya/models"
)
type driver struct{}
func (d *driver) New(conf *config.DataStore) tracker.Pool {
return &Pool{
users: make(map[string]*models.User),
torrents: make(map[string]*models.Torrent),
whitelist: make(map[string]bool),
}
}
func init() {
tracker.Register("mock", &driver{})
}