+10
-10
@@ -13,8 +13,8 @@ type TestModel struct {
|
||||
hash []byte
|
||||
weakHash uint32
|
||||
fromTemporary bool
|
||||
indexFn func(DeviceID, string, []FileInfo)
|
||||
ccFn func(DeviceID, ClusterConfig)
|
||||
indexFn func(string, []FileInfo)
|
||||
ccFn func(ClusterConfig)
|
||||
closedCh chan struct{}
|
||||
closedErr error
|
||||
}
|
||||
@@ -25,18 +25,18 @@ func newTestModel() *TestModel {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TestModel) Index(deviceID DeviceID, folder string, files []FileInfo) error {
|
||||
func (t *TestModel) Index(_ Connection, folder string, files []FileInfo) error {
|
||||
if t.indexFn != nil {
|
||||
t.indexFn(deviceID, folder, files)
|
||||
t.indexFn(folder, files)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*TestModel) IndexUpdate(_ DeviceID, _ string, _ []FileInfo) error {
|
||||
func (*TestModel) IndexUpdate(Connection, string, []FileInfo) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *TestModel) Request(_ DeviceID, folder, name string, _, size int32, offset int64, hash []byte, weakHash uint32, fromTemporary bool) (RequestResponse, error) {
|
||||
func (t *TestModel) Request(_ Connection, folder, name string, _, size int32, offset int64, hash []byte, weakHash uint32, fromTemporary bool) (RequestResponse, error) {
|
||||
t.folder = folder
|
||||
t.name = name
|
||||
t.offset = offset
|
||||
@@ -49,19 +49,19 @@ func (t *TestModel) Request(_ DeviceID, folder, name string, _, size int32, offs
|
||||
return &fakeRequestResponse{buf}, nil
|
||||
}
|
||||
|
||||
func (t *TestModel) Closed(_ DeviceID, err error) {
|
||||
func (t *TestModel) Closed(_ Connection, err error) {
|
||||
t.closedErr = err
|
||||
close(t.closedCh)
|
||||
}
|
||||
|
||||
func (t *TestModel) ClusterConfig(deviceID DeviceID, config ClusterConfig) error {
|
||||
func (t *TestModel) ClusterConfig(_ Connection, config ClusterConfig) error {
|
||||
if t.ccFn != nil {
|
||||
t.ccFn(deviceID, config)
|
||||
t.ccFn(config)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*TestModel) DownloadProgress(DeviceID, string, []FileDownloadProgressUpdate) error {
|
||||
func (*TestModel) DownloadProgress(Connection, string, []FileDownloadProgressUpdate) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user