databroker: add support for syncing by type (#3412)

* databroker: add support for syncing by type

* add type url, fix query
This commit is contained in:
Caleb Doxsey 2022-06-13 09:52:13 -06:00 committed by GitHub
parent 2487e9af20
commit 45a29ea879
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 163 additions and 125 deletions

View file

@ -210,6 +210,7 @@ func (backend *Backend) SetOptions(
// Sync syncs the records.
func (backend *Backend) Sync(
ctx context.Context,
recordType string,
serverVersion, recordVersion uint64,
) (storage.RecordStream, error) {
// the original ctx will be used for the stream, this ctx used for pre-stream calls
@ -224,7 +225,7 @@ func (backend *Backend) Sync(
return nil, storage.ErrInvalidServerVersion
}
return newChangedRecordStream(ctx, backend, recordVersion), nil
return newChangedRecordStream(ctx, backend, recordType, recordVersion), nil
}
// SyncLatest syncs the latest version of each record.