databroker: implement leases (#2172)

* databroker: implement leases

* return error

* handle gRPC errors
This commit is contained in:
Caleb Doxsey 2021-05-10 13:30:25 -06:00 committed by GitHub
parent a54d43b937
commit 94aa0b1a48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 2135 additions and 149 deletions

View file

@ -7,6 +7,9 @@ import (
"io"
)
//go:generate go run github.com/golang/mock/mockgen -source=databroker.pb.go -destination ./mock_databroker/databroker.pb.go DataBrokerServiceClient
//go:generate go run github.com/golang/mock/mockgen -source=leaser.go -destination ./mock_databroker/leaser.go LeaserHandler
// ApplyOffsetAndLimit applies the offset and limit to the list of records.
func ApplyOffsetAndLimit(all []*Record, offset, limit int) (records []*Record, totalCount int) {
records = all