initial delta support

This commit is contained in:
Jimmy Zelinskie
2014-02-22 23:47:11 -05:00
parent e8e692cbf6
commit e80b17b2ad
5 changed files with 80 additions and 11 deletions

View File

@@ -9,15 +9,46 @@ package mock
import (
"github.com/chihaya/chihaya/config"
"github.com/chihaya/chihaya/storage"
"github.com/chihaya/chihaya/storage/backend"
)
type driver struct{}
type mock struct{}
func (d *driver) New(conf *config.DataStore) backend.Conn {
return &mock{}
}
func (m *mock) Start() error {
return nil
}
func (m *mock) Close() error {
return nil
}
func (m *mock) RecordAnnounce(delta *backend.AnnounceDelta) error {
return nil
}
func (m *mock) LoadTorrents(ids []uint64) ([]*storage.Torrent, error) {
return nil, nil
}
func (m *mock) LoadAllTorrents() ([]*storage.Torrent, error) {
return nil, nil
}
func (m *mock) LoadUsers(ids []uint64) ([]*storage.User, error) {
return nil, nil
}
func (m *mock) LoadAllUsers(ids []uint64) ([]*storage.User, error) {
return nil, nil
}
func init() {
backend.Register("mock", &driver{})
}