mirror of
https://github.com/sot-tech/mochi.git
synced 2026-04-28 08:29:59 -07:00
initial delta support
This commit is contained in:
@@ -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{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user