mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-03 02:50:00 -07:00
initial delta support
This commit is contained in:
@@ -91,7 +91,7 @@ type AnnounceDelta struct {
|
||||
Downloaded uint64
|
||||
|
||||
// Timestamp is the unix timestamp this announce occurred at
|
||||
Timestamp float64
|
||||
Timestamp int64
|
||||
|
||||
// Snatched is true if this announce completed the download
|
||||
Snatched bool
|
||||
|
||||
@@ -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