lib/protocol: Further interface refactor (#9396)

This is a symmetric change to #9375 -- where that PR changed the
protocol->model interface, this changes the model->protocol one.
This commit is contained in:
Jakob Borg
2024-08-24 12:45:10 +02:00
committed by GitHub
parent 7df75e681d
commit 5342bec1b7
13 changed files with 170 additions and 221 deletions
+5 -5
View File
@@ -40,10 +40,10 @@ func TestIndexhandlerConcurrency(t *testing.T) {
c2.Start()
defer c2.Close(io.EOF)
c1.ClusterConfig(protocol.ClusterConfig{})
c2.ClusterConfig(protocol.ClusterConfig{})
c1.Index(ctx, "foo", nil)
c2.Index(ctx, "foo", nil)
c1.ClusterConfig(&protocol.ClusterConfig{})
c2.ClusterConfig(&protocol.ClusterConfig{})
c1.Index(ctx, &protocol.Index{Folder: "foo"})
c2.Index(ctx, &protocol.Index{Folder: "foo"})
const msgs = 5e2
const files = 1e3
@@ -64,7 +64,7 @@ func TestIndexhandlerConcurrency(t *testing.T) {
})
b1 := db.NewFileInfoBatch(func(fs []protocol.FileInfo) error {
return c1.IndexUpdate(ctx, "foo", fs)
return c1.IndexUpdate(ctx, &protocol.IndexUpdate{Folder: "foo", Files: fs})
})
sentEntries := 0
for i := 0; i < msgs; i++ {