From 04bdcb53bb67433c88f2985592a24215737627ec Mon Sep 17 00:00:00 2001 From: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:20:53 -0500 Subject: [PATCH 1/9] Update name indexer and send back cloudevents --- docs/docs.go | 46 ++- docs/swagger.json | 46 ++- docs/swagger.yaml | 53 ++- go.mod | 20 +- go.sum | 45 +- internal/fetch/fetch.go | 14 +- internal/fetch/httphandler/httphandler.go | 4 +- internal/fetch/rpc/rpc.go | 54 ++- pkg/grpc/cloudevent.pb.go | 354 ++++++++++++++++ pkg/grpc/cloudevent.proto | 59 +++ pkg/grpc/common.go | 40 ++ pkg/grpc/fetch-api.pb.go | 475 +++++++++------------- pkg/grpc/fetch-api.proto | 16 +- 13 files changed, 880 insertions(+), 346 deletions(-) create mode 100644 pkg/grpc/cloudevent.pb.go create mode 100644 pkg/grpc/cloudevent.proto create mode 100644 pkg/grpc/common.go diff --git a/docs/docs.go b/docs/docs.go index fc44343..2849d1b 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -255,7 +255,7 @@ const docTemplate = `{ "200": { "description": "Returns latest object data", "schema": { - "$ref": "#/definitions/indexrepo.DataObject" + "$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage" } }, "400": { @@ -337,7 +337,7 @@ const docTemplate = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/indexrepo.DataObject" + "$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage" } } }, @@ -364,16 +364,54 @@ const docTemplate = `{ } }, "definitions": { - "indexrepo.DataObject": { + "cloudevent.CloudEvent-json_RawMessage": { "type": "object", "properties": { "data": { + "description": "Data contains domain-specific information about the event.", "type": "array", "items": { "type": "integer" } }, - "indexKey": { + "datacontenttype": { + "description": "DataContentType is an optional MIME type for the data field. We almost\nalways serialize to JSON and in that case this field is implicitly\n\"application/json\".", + "type": "string" + }, + "dataschema": { + "description": "DataSchema is an optional URI pointing to a schema for the data field.", + "type": "string" + }, + "dataversion": { + "description": "DataVersion is the version of the data type.", + "type": "string" + }, + "id": { + "description": "ID is an identifier for the event. The combination of ID and Source must\nbe unique.", + "type": "string" + }, + "producer": { + "description": "Producer is a specific instance, process or device that creates the data structure describing the CloudEvent.", + "type": "string" + }, + "source": { + "description": "Source is the context in which the event happened. In a distributed system it might consist of multiple Producers.", + "type": "string" + }, + "specversion": { + "description": "SpecVersion is the version of CloudEvents specification used.\nThis is always hardcoded \"1.0\".", + "type": "string" + }, + "subject": { + "description": "Subject is an optional field identifying the subject of the event within\nthe context of the event producer. In practice, we always set this.", + "type": "string" + }, + "time": { + "description": "Time is an optional field giving the time at which the event occurred. In\npractice, we always set this.", + "type": "string" + }, + "type": { + "description": "Type describes the type of event. It should generally be a reverse-DNS\nname.", "type": "string" } } diff --git a/docs/swagger.json b/docs/swagger.json index 49df94e..63f82a2 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -246,7 +246,7 @@ "200": { "description": "Returns latest object data", "schema": { - "$ref": "#/definitions/indexrepo.DataObject" + "$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage" } }, "400": { @@ -328,7 +328,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/indexrepo.DataObject" + "$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage" } } }, @@ -355,16 +355,54 @@ } }, "definitions": { - "indexrepo.DataObject": { + "cloudevent.CloudEvent-json_RawMessage": { "type": "object", "properties": { "data": { + "description": "Data contains domain-specific information about the event.", "type": "array", "items": { "type": "integer" } }, - "indexKey": { + "datacontenttype": { + "description": "DataContentType is an optional MIME type for the data field. We almost\nalways serialize to JSON and in that case this field is implicitly\n\"application/json\".", + "type": "string" + }, + "dataschema": { + "description": "DataSchema is an optional URI pointing to a schema for the data field.", + "type": "string" + }, + "dataversion": { + "description": "DataVersion is the version of the data type.", + "type": "string" + }, + "id": { + "description": "ID is an identifier for the event. The combination of ID and Source must\nbe unique.", + "type": "string" + }, + "producer": { + "description": "Producer is a specific instance, process or device that creates the data structure describing the CloudEvent.", + "type": "string" + }, + "source": { + "description": "Source is the context in which the event happened. In a distributed system it might consist of multiple Producers.", + "type": "string" + }, + "specversion": { + "description": "SpecVersion is the version of CloudEvents specification used.\nThis is always hardcoded \"1.0\".", + "type": "string" + }, + "subject": { + "description": "Subject is an optional field identifying the subject of the event within\nthe context of the event producer. In practice, we always set this.", + "type": "string" + }, + "time": { + "description": "Time is an optional field giving the time at which the event occurred. In\npractice, we always set this.", + "type": "string" + }, + "type": { + "description": "Type describes the type of event. It should generally be a reverse-DNS\nname.", "type": "string" } } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index d5e96f9..5748041 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,11 +1,56 @@ definitions: - indexrepo.DataObject: + cloudevent.CloudEvent-json_RawMessage: properties: data: + description: Data contains domain-specific information about the event. items: type: integer type: array - indexKey: + datacontenttype: + description: |- + DataContentType is an optional MIME type for the data field. We almost + always serialize to JSON and in that case this field is implicitly + "application/json". + type: string + dataschema: + description: DataSchema is an optional URI pointing to a schema for the data + field. + type: string + dataversion: + description: DataVersion is the version of the data type. + type: string + id: + description: |- + ID is an identifier for the event. The combination of ID and Source must + be unique. + type: string + producer: + description: Producer is a specific instance, process or device that creates + the data structure describing the CloudEvent. + type: string + source: + description: Source is the context in which the event happened. In a distributed + system it might consist of multiple Producers. + type: string + specversion: + description: |- + SpecVersion is the version of CloudEvents specification used. + This is always hardcoded "1.0". + type: string + subject: + description: |- + Subject is an optional field identifying the subject of the event within + the context of the event producer. In practice, we always set this. + type: string + time: + description: |- + Time is an optional field giving the time at which the event occurred. In + practice, we always set this. + type: string + type: + description: |- + Type describes the type of event. It should generally be a reverse-DNS + name. type: string type: object internal_fetch_httphandler.indexKeyResponse: @@ -180,7 +225,7 @@ paths: "200": description: Returns latest object data schema: - $ref: '#/definitions/indexrepo.DataObject' + $ref: '#/definitions/cloudevent.CloudEvent-json_RawMessage' "400": description: Invalid request schema: @@ -233,7 +278,7 @@ paths: description: Returns latest object data schema: items: - $ref: '#/definitions/indexrepo.DataObject' + $ref: '#/definitions/cloudevent.CloudEvent-json_RawMessage' type: array "400": description: Invalid request diff --git a/go.mod b/go.mod index 0e9185e..4c337d2 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,8 @@ go 1.23 require ( github.com/ClickHouse/clickhouse-go/v2 v2.30.0 github.com/DIMO-Network/clickhouse-infra v0.0.3 - github.com/DIMO-Network/model-garage v0.3.3 - github.com/DIMO-Network/nameindexer v0.0.10-0.20241031131836-425572ba4fe9 + github.com/DIMO-Network/model-garage v0.4.2 + github.com/DIMO-Network/nameindexer v0.0.12-0.20241126175909-94075d731767 github.com/DIMO-Network/shared v0.11.1 github.com/aws/aws-sdk-go-v2 v1.32.2 github.com/aws/aws-sdk-go-v2/credentials v1.17.27 @@ -23,7 +23,7 @@ require ( github.com/rs/zerolog v1.33.0 github.com/stretchr/testify v1.9.0 github.com/swaggo/swag v1.16.4 - golang.org/x/sync v0.8.0 + golang.org/x/sync v0.9.0 google.golang.org/grpc v1.65.0 google.golang.org/protobuf v1.34.2 ) @@ -78,6 +78,10 @@ require ( github.com/shopspring/decimal v1.4.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/swaggo/files/v2 v2.0.0 // indirect + github.com/tidwall/gjson v1.18.0 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect + github.com/tidwall/sjson v1.2.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.55.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect @@ -86,12 +90,12 @@ require ( github.com/volatiletech/strmangle v0.0.6 // indirect go.opentelemetry.io/otel v1.28.0 // indirect go.opentelemetry.io/otel/trace v1.28.0 // indirect - golang.org/x/crypto v0.28.0 // indirect + golang.org/x/crypto v0.29.0 // indirect golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect - golang.org/x/net v0.30.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/text v0.19.0 // indirect - golang.org/x/tools v0.26.0 // indirect + golang.org/x/net v0.31.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/text v0.20.0 // indirect + golang.org/x/tools v0.27.0 // indirect golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240725223205-93522f1f2a9f // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index ff64361..4e17221 100644 --- a/go.sum +++ b/go.sum @@ -72,10 +72,10 @@ github.com/DATA-DOG/go-sqlmock v1.4.1 h1:ThlnYciV1iM/V0OSF/dtkqWb6xo5qITT1TJBG1M github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DIMO-Network/clickhouse-infra v0.0.3 h1:B6/4IY9IxLcyydET14IjHUT+A5SDEis7p//DoFzrMk4= github.com/DIMO-Network/clickhouse-infra v0.0.3/go.mod h1:NtpQ1btkPzebDvpYYygeqiiBmJ/q5oJb/T/JWzUVRlk= -github.com/DIMO-Network/model-garage v0.3.3 h1:Mb6wz1siYiZC20aoQwoSawzjXQqIvBhIsY4kKP63RSg= -github.com/DIMO-Network/model-garage v0.3.3/go.mod h1:TKajLKnkYw7n6cUuay6CBS15b81jVHRsQshW2WHeXzM= -github.com/DIMO-Network/nameindexer v0.0.10-0.20241031131836-425572ba4fe9 h1:EjmGhmuPDxWCYOJSFFASdNBXxfedTSwfaZIBAdA0PW8= -github.com/DIMO-Network/nameindexer v0.0.10-0.20241031131836-425572ba4fe9/go.mod h1:+X3K7NN7/DTwkwex5G0e+cqyUaGoCqqk8otOyjDxN+s= +github.com/DIMO-Network/model-garage v0.4.2 h1:TF+RNC1n1Y58QSdzmKaf5REixdariAP4tqHihzjSe70= +github.com/DIMO-Network/model-garage v0.4.2/go.mod h1:SXaBHFFARooOEoaV1wFaOC1K0LMt0bovkILsFXoUQTg= +github.com/DIMO-Network/nameindexer v0.0.12-0.20241126175909-94075d731767 h1:KZc2t4eIFuIwxztUstDxeAu87FKL4QQrNEbkO0VKQDU= +github.com/DIMO-Network/nameindexer v0.0.12-0.20241126175909-94075d731767/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= github.com/DIMO-Network/shared v0.11.1 h1:LpI2rROKjrBo6KO76sU3dZDvSv4YbQ4XUBEC4P5NosM= github.com/DIMO-Network/shared v0.11.1/go.mod h1:lm7rUB5i7Jx7t3EomtCwep0aC+sB+nlYYTJkTdUeKHM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -641,7 +641,16 @@ github.com/testcontainers/testcontainers-go v0.33.0 h1:zJS9PfXYT5O0ZFXM2xxXfk4J5 github.com/testcontainers/testcontainers-go v0.33.0/go.mod h1:W80YpTa8D5C3Yy16icheD01UTDu+LmXIA2Keo+jWtT8= github.com/testcontainers/testcontainers-go/modules/clickhouse v0.33.0 h1:YbB5DBkpgY+GlGPFqTSV1hzWPm3ZHirEyooZrj+ZXK0= github.com/testcontainers/testcontainers-go/modules/clickhouse v0.33.0/go.mod h1:qJuMPl9yWIWasmdBILM2uDk1Ny1kdeigcKMJ6A8PZz0= +github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= +github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= +github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= @@ -723,8 +732,8 @@ golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -763,8 +772,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= -golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -815,8 +824,8 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= -golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= +golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -850,8 +859,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -939,8 +948,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -952,8 +961,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1015,8 +1024,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= -golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= +golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= +golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/fetch/fetch.go b/internal/fetch/fetch.go index 86cfcbf..25f3000 100644 --- a/internal/fetch/fetch.go +++ b/internal/fetch/fetch.go @@ -3,16 +3,18 @@ package fetch import ( "context" + "encoding/json" "errors" "fmt" + "github.com/DIMO-Network/model-garage/pkg/cloudevent" "github.com/DIMO-Network/nameindexer/pkg/clickhouse/indexrepo" "github.com/aws/aws-sdk-go-v2/service/s3/types" ) // GetObjectsFromIndexs gets objects from the index service by trying to get them from each bucket in the list returning the first successful result. -func GetObjectsFromIndexs(ctx context.Context, idxSvc *indexrepo.Service, indexKeys []string, buckets []string) ([]indexrepo.DataObject, error) { - dataObjects := make([]indexrepo.DataObject, 0, len(indexKeys)) +func GetObjectsFromIndexs(ctx context.Context, idxSvc *indexrepo.Service, indexKeys []string, buckets []string) ([]cloudevent.CloudEvent[json.RawMessage], error) { + dataObjects := make([]cloudevent.CloudEvent[json.RawMessage], 0, len(indexKeys)) for _, key := range indexKeys { obj, err := GetObjectFromIndex(ctx, idxSvc, key, buckets) if err != nil { @@ -24,8 +26,8 @@ func GetObjectsFromIndexs(ctx context.Context, idxSvc *indexrepo.Service, indexK } // GetObjectFromIndex gets an object from the index service by trying to get it from each bucket in the list returning the first successful result. -func GetObjectFromIndex(ctx context.Context, idxSvc *indexrepo.Service, indexKeys string, buckets []string) (indexrepo.DataObject, error) { - var obj indexrepo.DataObject +func GetObjectFromIndex(ctx context.Context, idxSvc *indexrepo.Service, indexKeys string, buckets []string) (cloudevent.CloudEvent[json.RawMessage], error) { + var obj cloudevent.CloudEvent[json.RawMessage] var err error // Try to get the object from each bucket in the list for _, bucket := range buckets { @@ -35,9 +37,9 @@ func GetObjectFromIndex(ctx context.Context, idxSvc *indexrepo.Service, indexKey if errors.As(err, ¬FoundErr) { continue } - return indexrepo.DataObject{}, fmt.Errorf("failed to get object: %w", err) + return cloudevent.CloudEvent[json.RawMessage]{}, fmt.Errorf("failed to get object: %w", err) } return obj, nil } - return indexrepo.DataObject{}, fmt.Errorf("failed to get object: %w", err) + return cloudevent.CloudEvent[json.RawMessage]{}, fmt.Errorf("failed to get object: %w", err) } diff --git a/internal/fetch/httphandler/httphandler.go b/internal/fetch/httphandler/httphandler.go index 583d25b..ad67924 100644 --- a/internal/fetch/httphandler/httphandler.go +++ b/internal/fetch/httphandler/httphandler.go @@ -161,7 +161,7 @@ func (h *Handler) GetIndexKeys(fCtx *fiber.Ctx) error { // @Produce json // @Param params query searchParams false "Search parameters" // @Param tokenId path string true "Token ID" -// @Success 200 {object} []indexrepo.DataObject "Returns latest object data" +// @Success 200 {object} []cloudevent.CloudEvent[json.RawMessage] "Returns latest object data" // @Failure 400 {object} map[string]string "Invalid request" // @Failure 500 {object} map[string]string "Server error" // @Router /v1/vehicle/objects/{tokenId} [get] @@ -200,7 +200,7 @@ func (h *Handler) GetObjects(fCtx *fiber.Ctx) error { // @Produce json // @Param params query searchParams false "Search parameters" // @Param tokenId path string true "Token ID" -// @Success 200 {object} indexrepo.DataObject "Returns latest object data" +// @Success 200 {object} cloudevent.CloudEvent[json.RawMessage] "Returns latest object data" // @Failure 400 {object} map[string]string "Invalid request" // @Failure 500 {object} map[string]string "Server error" // @Router /v1/vehicle/latest-object/{tokenId} [get] diff --git a/internal/fetch/rpc/rpc.go b/internal/fetch/rpc/rpc.go index 867a9a8..d975935 100644 --- a/internal/fetch/rpc/rpc.go +++ b/internal/fetch/rpc/rpc.go @@ -3,13 +3,16 @@ package rpc import ( "context" + "encoding/json" "fmt" "time" "github.com/ClickHouse/clickhouse-go/v2" "github.com/DIMO-Network/fetch-api/internal/fetch" "github.com/DIMO-Network/fetch-api/pkg/grpc" + "github.com/DIMO-Network/model-garage/pkg/cloudevent" "github.com/DIMO-Network/nameindexer/pkg/clickhouse/indexrepo" + "google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/wrapperspb" ) @@ -62,14 +65,11 @@ func (s *Server) GetObjects(ctx context.Context, req *grpc.GetObjectsRequest) (* return nil, fmt.Errorf("failed to get latest object: %w", err) } - dataObjects := make([]*grpc.DataObject, len(data)) + events := make([]*grpc.CloudEvent, len(data)) for i, d := range data { - dataObjects[i] = &grpc.DataObject{ - IndexKey: d.IndexKey, - Data: d.Data, - } + events[i] = cloudEventToProto(d) } - return &grpc.GetObjectsResponse{DataObjects: dataObjects}, nil + return &grpc.GetObjectsResponse{CloudEvents: events}, nil } // GetLatestObject translates the gRPC call to the indexrepo type and fetches the latest data for the given options. @@ -83,10 +83,7 @@ func (s *Server) GetLatestObject(ctx context.Context, req *grpc.GetLatestObjectR if err != nil { return nil, fmt.Errorf("failed to get latest object: %w", err) } - return &grpc.GetLatestObjectResponse{DataObject: &grpc.DataObject{ - IndexKey: latestData.IndexKey, - Data: latestData.Data, - }}, nil + return &grpc.GetLatestObjectResponse{DataObject: cloudEventToProto(latestData)}, nil } // GetObjectsFromIndexKeys translates the gRPC call to the indexrepo type and fetches data for the given options. @@ -95,14 +92,11 @@ func (s *Server) GetObjectsFromIndexKeys(ctx context.Context, req *grpc.GetObjec if err != nil { return nil, fmt.Errorf("failed to get objects: %w", err) } - dataObjects := make([]*grpc.DataObject, len(data)) + dataObjects := make([]*grpc.CloudEvent, len(data)) for i, d := range data { - dataObjects[i] = &grpc.DataObject{ - IndexKey: d.IndexKey, - Data: d.Data, - } + dataObjects[i] = cloudEventToProto(d) } - return &grpc.GetObjectsFromIndexKeysResponse{DataObjects: dataObjects}, nil + return &grpc.GetObjectsFromIndexKeysResponse{CloudEvents: dataObjects}, nil } // translateProtoToSearchOptions translates a SearchOptions proto message to the Go SearchOptions type. @@ -151,3 +145,31 @@ func getStringValue(protoStr *wrapperspb.StringValue) *string { val := protoStr.GetValue() return &val } + +func cloudEventToProto(event cloudevent.CloudEvent[json.RawMessage]) *grpc.CloudEvent { + extras := make(map[string][]byte) + for k, v := range event.Extras { + v, err := json.Marshal(v) + if err != nil { + // Skip the extra if it can't be marshaled + continue + } + extras[k] = v + } + return &grpc.CloudEvent{ + Header: &grpc.CloudEventHeader{ + Id: event.ID, + Source: event.Source, + Producer: event.Producer, + Subject: event.Subject, + SpecVersion: event.SpecVersion, + Time: timestamppb.New(event.Time), + Type: event.Type, + DataContentType: event.DataContentType, + DataSchema: event.DataSchema, + DataVersion: event.DataVersion, + Extras: extras, + }, + Data: event.Data, + } +} diff --git a/pkg/grpc/cloudevent.pb.go b/pkg/grpc/cloudevent.pb.go new file mode 100644 index 0000000..cde5d22 --- /dev/null +++ b/pkg/grpc/cloudevent.pb.go @@ -0,0 +1,354 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.28.3 +// source: pkg/grpc/cloudevent.proto + +package grpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// CloudEvent represents a CloudEvent with a header and data. +type CloudEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *CloudEventHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *CloudEvent) Reset() { + *x = CloudEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_grpc_cloudevent_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloudEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudEvent) ProtoMessage() {} + +func (x *CloudEvent) ProtoReflect() protoreflect.Message { + mi := &file_pkg_grpc_cloudevent_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudEvent.ProtoReflect.Descriptor instead. +func (*CloudEvent) Descriptor() ([]byte, []int) { + return file_pkg_grpc_cloudevent_proto_rawDescGZIP(), []int{0} +} + +func (x *CloudEvent) GetHeader() *CloudEventHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *CloudEvent) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// CloudEventHeader represents the header structure of a CloudEvent. +type CloudEventHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID is an identifier for the event. The combination of ID and Source must + // be unique. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Source is the context in which the event happened. In a distributed system it might consist of multiple Producers. + // Typically the 0x address. + Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` + // Producer is a specific instance, process or device that creates the data structure describing the CloudEvent. + // Typically a DID of a nft. + Producer string `protobuf:"bytes,3,opt,name=producer,proto3" json:"producer,omitempty"` + // SpecVersion is the version of CloudEvents specification used. + // This is always hardcoded "1.0". + SpecVersion string `protobuf:"bytes,4,opt,name=spec_version,json=specVersion,proto3" json:"spec_version,omitempty"` + // Subject is an optional field identifying the subject of the event within + // the context of the event producer. + // Typically the DID of the nft. + Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` + // Time which the event occurred. + Time *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=time,proto3" json:"time,omitempty"` + // Type describes the type of event. + // Typically a one of the predefined DIMO types. (dimo.status, dimo.fingerprint, dimo.verfiabaleCredential...) + Type string `protobuf:"bytes,7,opt,name=type,proto3" json:"type,omitempty"` + // DataContentType is an optional MIME type for the data field. We almost + // always serialize to JSON and in that case this field is implicitly + // "application/json". + DataContentType string `protobuf:"bytes,8,opt,name=data_content_type,json=dataContentType,proto3" json:"data_content_type,omitempty"` + // DataSchema is an optional URI pointing to a schema for the data field. + DataSchema string `protobuf:"bytes,9,opt,name=data_schema,json=dataSchema,proto3" json:"data_schema,omitempty"` + // DataVersion is the controlled by the source of the event and is used to provide information about the data. + DataVersion string `protobuf:"bytes,10,opt,name=data_version,json=dataVersion,proto3" json:"data_version,omitempty"` + // Extras contains any additional fields that are not part of the CloudEvent excluding the data field. + Extras map[string][]byte `protobuf:"bytes,11,rep,name=extras,proto3" json:"extras,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *CloudEventHeader) Reset() { + *x = CloudEventHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_grpc_cloudevent_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloudEventHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudEventHeader) ProtoMessage() {} + +func (x *CloudEventHeader) ProtoReflect() protoreflect.Message { + mi := &file_pkg_grpc_cloudevent_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudEventHeader.ProtoReflect.Descriptor instead. +func (*CloudEventHeader) Descriptor() ([]byte, []int) { + return file_pkg_grpc_cloudevent_proto_rawDescGZIP(), []int{1} +} + +func (x *CloudEventHeader) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *CloudEventHeader) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *CloudEventHeader) GetProducer() string { + if x != nil { + return x.Producer + } + return "" +} + +func (x *CloudEventHeader) GetSpecVersion() string { + if x != nil { + return x.SpecVersion + } + return "" +} + +func (x *CloudEventHeader) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *CloudEventHeader) GetTime() *timestamppb.Timestamp { + if x != nil { + return x.Time + } + return nil +} + +func (x *CloudEventHeader) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *CloudEventHeader) GetDataContentType() string { + if x != nil { + return x.DataContentType + } + return "" +} + +func (x *CloudEventHeader) GetDataSchema() string { + if x != nil { + return x.DataSchema + } + return "" +} + +func (x *CloudEventHeader) GetDataVersion() string { + if x != nil { + return x.DataVersion + } + return "" +} + +func (x *CloudEventHeader) GetExtras() map[string][]byte { + if x != nil { + return x.Extras + } + return nil +} + +var File_pkg_grpc_cloudevent_proto protoreflect.FileDescriptor + +var file_pkg_grpc_cloudevent_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x0a, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x22, 0xc4, 0x03, 0x0a, 0x10, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x70, 0x65, + 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x73, 0x70, 0x65, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x64, 0x61, + 0x74, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x61, 0x74, + 0x61, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x61, 0x74, 0x61, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x06, 0x65, 0x78, + 0x74, 0x72, 0x61, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x65, 0x78, 0x74, 0x72, 0x61, 0x73, 0x1a, 0x39, 0x0a, 0x0b, + 0x45, 0x78, 0x74, 0x72, 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pkg_grpc_cloudevent_proto_rawDescOnce sync.Once + file_pkg_grpc_cloudevent_proto_rawDescData = file_pkg_grpc_cloudevent_proto_rawDesc +) + +func file_pkg_grpc_cloudevent_proto_rawDescGZIP() []byte { + file_pkg_grpc_cloudevent_proto_rawDescOnce.Do(func() { + file_pkg_grpc_cloudevent_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_grpc_cloudevent_proto_rawDescData) + }) + return file_pkg_grpc_cloudevent_proto_rawDescData +} + +var file_pkg_grpc_cloudevent_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_pkg_grpc_cloudevent_proto_goTypes = []any{ + (*CloudEvent)(nil), // 0: cloudevent.CloudEvent + (*CloudEventHeader)(nil), // 1: cloudevent.CloudEventHeader + nil, // 2: cloudevent.CloudEventHeader.ExtrasEntry + (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp +} +var file_pkg_grpc_cloudevent_proto_depIdxs = []int32{ + 1, // 0: cloudevent.CloudEvent.header:type_name -> cloudevent.CloudEventHeader + 3, // 1: cloudevent.CloudEventHeader.time:type_name -> google.protobuf.Timestamp + 2, // 2: cloudevent.CloudEventHeader.extras:type_name -> cloudevent.CloudEventHeader.ExtrasEntry + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_pkg_grpc_cloudevent_proto_init() } +func file_pkg_grpc_cloudevent_proto_init() { + if File_pkg_grpc_cloudevent_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pkg_grpc_cloudevent_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*CloudEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_grpc_cloudevent_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*CloudEventHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pkg_grpc_cloudevent_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pkg_grpc_cloudevent_proto_goTypes, + DependencyIndexes: file_pkg_grpc_cloudevent_proto_depIdxs, + MessageInfos: file_pkg_grpc_cloudevent_proto_msgTypes, + }.Build() + File_pkg_grpc_cloudevent_proto = out.File + file_pkg_grpc_cloudevent_proto_rawDesc = nil + file_pkg_grpc_cloudevent_proto_goTypes = nil + file_pkg_grpc_cloudevent_proto_depIdxs = nil +} diff --git a/pkg/grpc/cloudevent.proto b/pkg/grpc/cloudevent.proto new file mode 100644 index 0000000..7379834 --- /dev/null +++ b/pkg/grpc/cloudevent.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +package cloudevent; + +option go_package = "github.com/DIMO-Network/fetch-api/pkg/grpc"; + +import "google/protobuf/timestamp.proto"; + +// CloudEvent represents a CloudEvent with a header and data. +message CloudEvent { + CloudEventHeader header = 1; + bytes data = 2; + } + +// CloudEventHeader represents the header structure of a CloudEvent. +message CloudEventHeader { + // ID is an identifier for the event. The combination of ID and Source must + // be unique. + string id = 1; + + // Source is the context in which the event happened. In a distributed system it might consist of multiple Producers. + // Typically the 0x address. + string source = 2; + + // Producer is a specific instance, process or device that creates the data structure describing the CloudEvent. + // Typically a DID of a nft. + string producer = 3; + + // SpecVersion is the version of CloudEvents specification used. + // This is always hardcoded "1.0". + string spec_version = 4; + + // Subject is an optional field identifying the subject of the event within + // the context of the event producer. + // Typically the DID of the nft. + string subject = 5; + + // Time which the event occurred. + google.protobuf.Timestamp time = 6; + + // Type describes the type of event. + // Typically a one of the predefined DIMO types. (dimo.status, dimo.fingerprint, dimo.verfiabaleCredential...) + string type = 7; + + // DataContentType is an optional MIME type for the data field. We almost + // always serialize to JSON and in that case this field is implicitly + // "application/json". + string data_content_type = 8; + + // DataSchema is an optional URI pointing to a schema for the data field. + string data_schema = 9; + + // DataVersion is the controlled by the source of the event and is used to provide information about the data. + string data_version = 10; + + // Extras contains any additional fields that are not part of the CloudEvent excluding the data field. + map extras = 11; +} + diff --git a/pkg/grpc/common.go b/pkg/grpc/common.go new file mode 100644 index 0000000..dfb4ff0 --- /dev/null +++ b/pkg/grpc/common.go @@ -0,0 +1,40 @@ +package grpc + +import ( + "encoding/json" + + "github.com/DIMO-Network/model-garage/pkg/cloudevent" +) + +// AsCloudEvent converts the CloudEvent to a cloudevent.CloudEvent[json.RawMessage]. +func (c *CloudEvent) AsCloudEvent() cloudevent.CloudEvent[json.RawMessage] { + return cloudevent.CloudEvent[json.RawMessage]{ + CloudEventHeader: c.GetHeader().AsCloudEventHeader(), + Data: c.GetData(), + } +} + +// AsCloudEventHeader converts the CloudEventHeader to a cloudevent.CloudEventHeader. +func (c *CloudEventHeader) AsCloudEventHeader() cloudevent.CloudEventHeader { + extras := make(map[string]any, len(c.GetExtras())) + for k, v := range c.GetExtras() { + var val any + if err := json.Unmarshal(v, &val); err != nil { + val = v + } + extras[k] = val + } + return cloudevent.CloudEventHeader{ + ID: c.GetId(), + Source: c.GetSource(), + Producer: c.GetProducer(), + SpecVersion: c.GetSpecVersion(), + Subject: c.GetSubject(), + Time: c.GetTime().AsTime(), + Type: c.GetType(), + DataContentType: c.GetDataContentType(), + DataSchema: c.GetDataSchema(), + DataVersion: c.GetDataVersion(), + Extras: extras, + } +} diff --git a/pkg/grpc/fetch-api.pb.go b/pkg/grpc/fetch-api.pb.go index f371055..dd52393 100644 --- a/pkg/grpc/fetch-api.pb.go +++ b/pkg/grpc/fetch-api.pb.go @@ -153,64 +153,6 @@ func (x *SearchOptions) GetOptional() *wrapperspb.StringValue { return nil } -// DataObject contains the index key and data retrieved from the object. -type DataObject struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The index key of the object. - IndexKey string `protobuf:"bytes,1,opt,name=index_key,json=indexKey,proto3" json:"index_key,omitempty"` - // The data retrieved from the object. - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *DataObject) Reset() { - *x = DataObject{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DataObject) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataObject) ProtoMessage() {} - -func (x *DataObject) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DataObject.ProtoReflect.Descriptor instead. -func (*DataObject) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{1} -} - -func (x *DataObject) GetIndexKey() string { - if x != nil { - return x.IndexKey - } - return "" -} - -func (x *DataObject) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - // GetLatestIndexKeyRequest includes search options to filter the events. type GetLatestIndexKeyRequest struct { state protoimpl.MessageState @@ -223,7 +165,7 @@ type GetLatestIndexKeyRequest struct { func (x *GetLatestIndexKeyRequest) Reset() { *x = GetLatestIndexKeyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[2] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -236,7 +178,7 @@ func (x *GetLatestIndexKeyRequest) String() string { func (*GetLatestIndexKeyRequest) ProtoMessage() {} func (x *GetLatestIndexKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[2] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -249,7 +191,7 @@ func (x *GetLatestIndexKeyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLatestIndexKeyRequest.ProtoReflect.Descriptor instead. func (*GetLatestIndexKeyRequest) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{2} + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{1} } func (x *GetLatestIndexKeyRequest) GetOptions() *SearchOptions { @@ -272,7 +214,7 @@ type GetLatestIndexKeyResponse struct { func (x *GetLatestIndexKeyResponse) Reset() { *x = GetLatestIndexKeyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[3] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -285,7 +227,7 @@ func (x *GetLatestIndexKeyResponse) String() string { func (*GetLatestIndexKeyResponse) ProtoMessage() {} func (x *GetLatestIndexKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[3] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -298,7 +240,7 @@ func (x *GetLatestIndexKeyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLatestIndexKeyResponse.ProtoReflect.Descriptor instead. func (*GetLatestIndexKeyResponse) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{3} + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{2} } func (x *GetLatestIndexKeyResponse) GetIndexKey() string { @@ -323,7 +265,7 @@ type GetIndexKeysRequest struct { func (x *GetIndexKeysRequest) Reset() { *x = GetIndexKeysRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[4] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -336,7 +278,7 @@ func (x *GetIndexKeysRequest) String() string { func (*GetIndexKeysRequest) ProtoMessage() {} func (x *GetIndexKeysRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[4] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -349,7 +291,7 @@ func (x *GetIndexKeysRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetIndexKeysRequest.ProtoReflect.Descriptor instead. func (*GetIndexKeysRequest) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{4} + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{3} } func (x *GetIndexKeysRequest) GetOptions() *SearchOptions { @@ -379,7 +321,7 @@ type GetIndexKeysResponse struct { func (x *GetIndexKeysResponse) Reset() { *x = GetIndexKeysResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[5] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -392,7 +334,7 @@ func (x *GetIndexKeysResponse) String() string { func (*GetIndexKeysResponse) ProtoMessage() {} func (x *GetIndexKeysResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[5] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -405,7 +347,7 @@ func (x *GetIndexKeysResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetIndexKeysResponse.ProtoReflect.Descriptor instead. func (*GetIndexKeysResponse) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{5} + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{4} } func (x *GetIndexKeysResponse) GetIndexKeys() []string { @@ -428,7 +370,7 @@ type GetLatestObjectRequest struct { func (x *GetLatestObjectRequest) Reset() { *x = GetLatestObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[6] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -441,7 +383,7 @@ func (x *GetLatestObjectRequest) String() string { func (*GetLatestObjectRequest) ProtoMessage() {} func (x *GetLatestObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[6] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -454,7 +396,7 @@ func (x *GetLatestObjectRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLatestObjectRequest.ProtoReflect.Descriptor instead. func (*GetLatestObjectRequest) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{6} + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{5} } func (x *GetLatestObjectRequest) GetOptions() *SearchOptions { @@ -471,13 +413,13 @@ type GetLatestObjectResponse struct { unknownFields protoimpl.UnknownFields // The data retrieved from the latest cloud event. - DataObject *DataObject `protobuf:"bytes,1,opt,name=data_object,json=dataObject,proto3" json:"data_object,omitempty"` + DataObject *CloudEvent `protobuf:"bytes,1,opt,name=data_object,json=dataObject,proto3" json:"data_object,omitempty"` } func (x *GetLatestObjectResponse) Reset() { *x = GetLatestObjectResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[7] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -490,7 +432,7 @@ func (x *GetLatestObjectResponse) String() string { func (*GetLatestObjectResponse) ProtoMessage() {} func (x *GetLatestObjectResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[7] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -503,10 +445,10 @@ func (x *GetLatestObjectResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLatestObjectResponse.ProtoReflect.Descriptor instead. func (*GetLatestObjectResponse) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{7} + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{6} } -func (x *GetLatestObjectResponse) GetDataObject() *DataObject { +func (x *GetLatestObjectResponse) GetDataObject() *CloudEvent { if x != nil { return x.DataObject } @@ -528,7 +470,7 @@ type GetObjectsRequest struct { func (x *GetObjectsRequest) Reset() { *x = GetObjectsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[8] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -541,7 +483,7 @@ func (x *GetObjectsRequest) String() string { func (*GetObjectsRequest) ProtoMessage() {} func (x *GetObjectsRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[8] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -554,7 +496,7 @@ func (x *GetObjectsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetObjectsRequest.ProtoReflect.Descriptor instead. func (*GetObjectsRequest) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{8} + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{7} } func (x *GetObjectsRequest) GetOptions() *SearchOptions { @@ -578,13 +520,13 @@ type GetObjectsResponse struct { unknownFields protoimpl.UnknownFields // The list of data retrieved from the objects. - DataObjects []*DataObject `protobuf:"bytes,1,rep,name=data_objects,json=dataObjects,proto3" json:"data_objects,omitempty"` + CloudEvents []*CloudEvent `protobuf:"bytes,1,rep,name=cloud_events,json=cloudEvents,proto3" json:"cloud_events,omitempty"` } func (x *GetObjectsResponse) Reset() { *x = GetObjectsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[9] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -597,7 +539,7 @@ func (x *GetObjectsResponse) String() string { func (*GetObjectsResponse) ProtoMessage() {} func (x *GetObjectsResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[9] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -610,12 +552,12 @@ func (x *GetObjectsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetObjectsResponse.ProtoReflect.Descriptor instead. func (*GetObjectsResponse) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{9} + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{8} } -func (x *GetObjectsResponse) GetDataObjects() []*DataObject { +func (x *GetObjectsResponse) GetCloudEvents() []*CloudEvent { if x != nil { - return x.DataObjects + return x.CloudEvents } return nil } @@ -633,7 +575,7 @@ type GetObjectsFromIndexKeysRequest struct { func (x *GetObjectsFromIndexKeysRequest) Reset() { *x = GetObjectsFromIndexKeysRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[10] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -646,7 +588,7 @@ func (x *GetObjectsFromIndexKeysRequest) String() string { func (*GetObjectsFromIndexKeysRequest) ProtoMessage() {} func (x *GetObjectsFromIndexKeysRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[10] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -659,7 +601,7 @@ func (x *GetObjectsFromIndexKeysRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetObjectsFromIndexKeysRequest.ProtoReflect.Descriptor instead. func (*GetObjectsFromIndexKeysRequest) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{10} + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{9} } func (x *GetObjectsFromIndexKeysRequest) GetIndexKeys() []string { @@ -676,13 +618,13 @@ type GetObjectsFromIndexKeysResponse struct { unknownFields protoimpl.UnknownFields // The list of data retrieved from the objects. - DataObjects []*DataObject `protobuf:"bytes,1,rep,name=data_objects,json=dataObjects,proto3" json:"data_objects,omitempty"` + CloudEvents []*CloudEvent `protobuf:"bytes,1,rep,name=cloud_events,json=cloudEvents,proto3" json:"cloud_events,omitempty"` } func (x *GetObjectsFromIndexKeysResponse) Reset() { *x = GetObjectsFromIndexKeysResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[11] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -695,7 +637,7 @@ func (x *GetObjectsFromIndexKeysResponse) String() string { func (*GetObjectsFromIndexKeysResponse) ProtoMessage() {} func (x *GetObjectsFromIndexKeysResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[11] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -708,12 +650,12 @@ func (x *GetObjectsFromIndexKeysResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetObjectsFromIndexKeysResponse.ProtoReflect.Descriptor instead. func (*GetObjectsFromIndexKeysResponse) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{11} + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{10} } -func (x *GetObjectsFromIndexKeysResponse) GetDataObjects() []*DataObject { +func (x *GetObjectsFromIndexKeysResponse) GetCloudEvents() []*CloudEvent { if x != nil { - return x.DataObjects + return x.CloudEvents } return nil } @@ -727,126 +669,124 @@ var file_pkg_grpc_fetch_api_proto_rawDesc = []byte{ 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xe1, 0x04, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, - 0x61, 0x66, 0x74, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x3f, 0x0a, 0x0d, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x61, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x6f, 0x1a, 0x19, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe1, 0x04, 0x0a, + 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, + 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, + 0x12, 0x32, 0x0a, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x41, 0x73, 0x63, 0x12, 0x43, 0x0a, 0x0e, 0x70, 0x72, - 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x0d, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x12, - 0x39, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x73, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x47, 0x0a, 0x10, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x5f, - 0x66, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x6f, - 0x6e, 0x64, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x06, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x12, 0x38, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x06, 0x62, 0x65, + 0x66, 0x6f, 0x72, 0x65, 0x12, 0x3f, 0x0a, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x5f, 0x61, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, + 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x41, 0x73, 0x63, 0x12, 0x43, 0x0a, 0x0e, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, + 0x5f, 0x66, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0x3d, 0x0a, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, - 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x22, 0x49, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, - 0x38, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x22, 0x5a, 0x0a, 0x13, 0x47, 0x65, 0x74, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x35, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x47, 0x0a, 0x16, - 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x4c, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x31, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x61, 0x74, - 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x22, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x49, 0x0a, - 0x12, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x0b, 0x64, 0x61, 0x74, - 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x3f, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, - 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x56, 0x0a, 0x1f, 0x47, 0x65, 0x74, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x0c, - 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x73, 0x32, 0xa4, 0x03, 0x0a, 0x0c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x54, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x1e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, - 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x70, 0x72, 0x69, + 0x6d, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x09, 0x64, 0x61, + 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, + 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x47, 0x0a, + 0x10, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x6c, 0x65, + 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, + 0x46, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x22, 0x49, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x38, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, - 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x17, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, - 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x66, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, - 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x24, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, - 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2d, 0x67, 0x61, 0x72, 0x61, 0x67, 0x65, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x4b, 0x65, 0x79, 0x22, 0x5a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x22, 0x35, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x47, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0x52, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0b, + 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, + 0x4f, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x22, 0x3f, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, + 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, + 0x73, 0x22, 0x5c, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, + 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x32, + 0xa4, 0x03, 0x0a, 0x0c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x54, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x1e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, + 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, + 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, + 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, + 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, + 0x0a, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, + 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -861,52 +801,52 @@ func file_pkg_grpc_fetch_api_proto_rawDescGZIP() []byte { return file_pkg_grpc_fetch_api_proto_rawDescData } -var file_pkg_grpc_fetch_api_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_pkg_grpc_fetch_api_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_pkg_grpc_fetch_api_proto_goTypes = []any{ (*SearchOptions)(nil), // 0: grpc.SearchOptions - (*DataObject)(nil), // 1: grpc.DataObject - (*GetLatestIndexKeyRequest)(nil), // 2: grpc.GetLatestIndexKeyRequest - (*GetLatestIndexKeyResponse)(nil), // 3: grpc.GetLatestIndexKeyResponse - (*GetIndexKeysRequest)(nil), // 4: grpc.GetIndexKeysRequest - (*GetIndexKeysResponse)(nil), // 5: grpc.GetIndexKeysResponse - (*GetLatestObjectRequest)(nil), // 6: grpc.GetLatestObjectRequest - (*GetLatestObjectResponse)(nil), // 7: grpc.GetLatestObjectResponse - (*GetObjectsRequest)(nil), // 8: grpc.GetObjectsRequest - (*GetObjectsResponse)(nil), // 9: grpc.GetObjectsResponse - (*GetObjectsFromIndexKeysRequest)(nil), // 10: grpc.GetObjectsFromIndexKeysRequest - (*GetObjectsFromIndexKeysResponse)(nil), // 11: grpc.GetObjectsFromIndexKeysResponse - (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp - (*wrapperspb.BoolValue)(nil), // 13: google.protobuf.BoolValue - (*wrapperspb.StringValue)(nil), // 14: google.protobuf.StringValue + (*GetLatestIndexKeyRequest)(nil), // 1: grpc.GetLatestIndexKeyRequest + (*GetLatestIndexKeyResponse)(nil), // 2: grpc.GetLatestIndexKeyResponse + (*GetIndexKeysRequest)(nil), // 3: grpc.GetIndexKeysRequest + (*GetIndexKeysResponse)(nil), // 4: grpc.GetIndexKeysResponse + (*GetLatestObjectRequest)(nil), // 5: grpc.GetLatestObjectRequest + (*GetLatestObjectResponse)(nil), // 6: grpc.GetLatestObjectResponse + (*GetObjectsRequest)(nil), // 7: grpc.GetObjectsRequest + (*GetObjectsResponse)(nil), // 8: grpc.GetObjectsResponse + (*GetObjectsFromIndexKeysRequest)(nil), // 9: grpc.GetObjectsFromIndexKeysRequest + (*GetObjectsFromIndexKeysResponse)(nil), // 10: grpc.GetObjectsFromIndexKeysResponse + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp + (*wrapperspb.BoolValue)(nil), // 12: google.protobuf.BoolValue + (*wrapperspb.StringValue)(nil), // 13: google.protobuf.StringValue + (*CloudEvent)(nil), // 14: cloudevent.CloudEvent } var file_pkg_grpc_fetch_api_proto_depIdxs = []int32{ - 12, // 0: grpc.SearchOptions.after:type_name -> google.protobuf.Timestamp - 12, // 1: grpc.SearchOptions.before:type_name -> google.protobuf.Timestamp - 13, // 2: grpc.SearchOptions.timestamp_asc:type_name -> google.protobuf.BoolValue - 14, // 3: grpc.SearchOptions.primary_filler:type_name -> google.protobuf.StringValue - 14, // 4: grpc.SearchOptions.data_type:type_name -> google.protobuf.StringValue - 14, // 5: grpc.SearchOptions.subject:type_name -> google.protobuf.StringValue - 14, // 6: grpc.SearchOptions.secondary_filler:type_name -> google.protobuf.StringValue - 14, // 7: grpc.SearchOptions.source:type_name -> google.protobuf.StringValue - 14, // 8: grpc.SearchOptions.producer:type_name -> google.protobuf.StringValue - 14, // 9: grpc.SearchOptions.optional:type_name -> google.protobuf.StringValue + 11, // 0: grpc.SearchOptions.after:type_name -> google.protobuf.Timestamp + 11, // 1: grpc.SearchOptions.before:type_name -> google.protobuf.Timestamp + 12, // 2: grpc.SearchOptions.timestamp_asc:type_name -> google.protobuf.BoolValue + 13, // 3: grpc.SearchOptions.primary_filler:type_name -> google.protobuf.StringValue + 13, // 4: grpc.SearchOptions.data_type:type_name -> google.protobuf.StringValue + 13, // 5: grpc.SearchOptions.subject:type_name -> google.protobuf.StringValue + 13, // 6: grpc.SearchOptions.secondary_filler:type_name -> google.protobuf.StringValue + 13, // 7: grpc.SearchOptions.source:type_name -> google.protobuf.StringValue + 13, // 8: grpc.SearchOptions.producer:type_name -> google.protobuf.StringValue + 13, // 9: grpc.SearchOptions.optional:type_name -> google.protobuf.StringValue 0, // 10: grpc.GetLatestIndexKeyRequest.options:type_name -> grpc.SearchOptions 0, // 11: grpc.GetIndexKeysRequest.options:type_name -> grpc.SearchOptions 0, // 12: grpc.GetLatestObjectRequest.options:type_name -> grpc.SearchOptions - 1, // 13: grpc.GetLatestObjectResponse.data_object:type_name -> grpc.DataObject + 14, // 13: grpc.GetLatestObjectResponse.data_object:type_name -> cloudevent.CloudEvent 0, // 14: grpc.GetObjectsRequest.options:type_name -> grpc.SearchOptions - 1, // 15: grpc.GetObjectsResponse.data_objects:type_name -> grpc.DataObject - 1, // 16: grpc.GetObjectsFromIndexKeysResponse.data_objects:type_name -> grpc.DataObject - 2, // 17: grpc.FetchService.GetLatestIndexKey:input_type -> grpc.GetLatestIndexKeyRequest - 4, // 18: grpc.FetchService.GetIndexKeys:input_type -> grpc.GetIndexKeysRequest - 6, // 19: grpc.FetchService.GetLatestObject:input_type -> grpc.GetLatestObjectRequest - 8, // 20: grpc.FetchService.GetObjects:input_type -> grpc.GetObjectsRequest - 10, // 21: grpc.FetchService.GetObjectsFromIndexKeys:input_type -> grpc.GetObjectsFromIndexKeysRequest - 3, // 22: grpc.FetchService.GetLatestIndexKey:output_type -> grpc.GetLatestIndexKeyResponse - 5, // 23: grpc.FetchService.GetIndexKeys:output_type -> grpc.GetIndexKeysResponse - 7, // 24: grpc.FetchService.GetLatestObject:output_type -> grpc.GetLatestObjectResponse - 9, // 25: grpc.FetchService.GetObjects:output_type -> grpc.GetObjectsResponse - 11, // 26: grpc.FetchService.GetObjectsFromIndexKeys:output_type -> grpc.GetObjectsFromIndexKeysResponse + 14, // 15: grpc.GetObjectsResponse.cloud_events:type_name -> cloudevent.CloudEvent + 14, // 16: grpc.GetObjectsFromIndexKeysResponse.cloud_events:type_name -> cloudevent.CloudEvent + 1, // 17: grpc.FetchService.GetLatestIndexKey:input_type -> grpc.GetLatestIndexKeyRequest + 3, // 18: grpc.FetchService.GetIndexKeys:input_type -> grpc.GetIndexKeysRequest + 5, // 19: grpc.FetchService.GetLatestObject:input_type -> grpc.GetLatestObjectRequest + 7, // 20: grpc.FetchService.GetObjects:input_type -> grpc.GetObjectsRequest + 9, // 21: grpc.FetchService.GetObjectsFromIndexKeys:input_type -> grpc.GetObjectsFromIndexKeysRequest + 2, // 22: grpc.FetchService.GetLatestIndexKey:output_type -> grpc.GetLatestIndexKeyResponse + 4, // 23: grpc.FetchService.GetIndexKeys:output_type -> grpc.GetIndexKeysResponse + 6, // 24: grpc.FetchService.GetLatestObject:output_type -> grpc.GetLatestObjectResponse + 8, // 25: grpc.FetchService.GetObjects:output_type -> grpc.GetObjectsResponse + 10, // 26: grpc.FetchService.GetObjectsFromIndexKeys:output_type -> grpc.GetObjectsFromIndexKeysResponse 22, // [22:27] is the sub-list for method output_type 17, // [17:22] is the sub-list for method input_type 17, // [17:17] is the sub-list for extension type_name @@ -919,6 +859,7 @@ func file_pkg_grpc_fetch_api_proto_init() { if File_pkg_grpc_fetch_api_proto != nil { return } + file_pkg_grpc_cloudevent_proto_init() if !protoimpl.UnsafeEnabled { file_pkg_grpc_fetch_api_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*SearchOptions); i { @@ -933,18 +874,6 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*DataObject); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_grpc_fetch_api_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*GetLatestIndexKeyRequest); i { case 0: return &v.state @@ -956,7 +885,7 @@ func file_pkg_grpc_fetch_api_proto_init() { return nil } } - file_pkg_grpc_fetch_api_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_pkg_grpc_fetch_api_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*GetLatestIndexKeyResponse); i { case 0: return &v.state @@ -968,7 +897,7 @@ func file_pkg_grpc_fetch_api_proto_init() { return nil } } - file_pkg_grpc_fetch_api_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_pkg_grpc_fetch_api_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*GetIndexKeysRequest); i { case 0: return &v.state @@ -980,7 +909,7 @@ func file_pkg_grpc_fetch_api_proto_init() { return nil } } - file_pkg_grpc_fetch_api_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_pkg_grpc_fetch_api_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*GetIndexKeysResponse); i { case 0: return &v.state @@ -992,7 +921,7 @@ func file_pkg_grpc_fetch_api_proto_init() { return nil } } - file_pkg_grpc_fetch_api_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_pkg_grpc_fetch_api_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*GetLatestObjectRequest); i { case 0: return &v.state @@ -1004,7 +933,7 @@ func file_pkg_grpc_fetch_api_proto_init() { return nil } } - file_pkg_grpc_fetch_api_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_pkg_grpc_fetch_api_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*GetLatestObjectResponse); i { case 0: return &v.state @@ -1016,7 +945,7 @@ func file_pkg_grpc_fetch_api_proto_init() { return nil } } - file_pkg_grpc_fetch_api_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_pkg_grpc_fetch_api_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*GetObjectsRequest); i { case 0: return &v.state @@ -1028,7 +957,7 @@ func file_pkg_grpc_fetch_api_proto_init() { return nil } } - file_pkg_grpc_fetch_api_proto_msgTypes[9].Exporter = func(v any, i int) any { + file_pkg_grpc_fetch_api_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*GetObjectsResponse); i { case 0: return &v.state @@ -1040,7 +969,7 @@ func file_pkg_grpc_fetch_api_proto_init() { return nil } } - file_pkg_grpc_fetch_api_proto_msgTypes[10].Exporter = func(v any, i int) any { + file_pkg_grpc_fetch_api_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*GetObjectsFromIndexKeysRequest); i { case 0: return &v.state @@ -1052,7 +981,7 @@ func file_pkg_grpc_fetch_api_proto_init() { return nil } } - file_pkg_grpc_fetch_api_proto_msgTypes[11].Exporter = func(v any, i int) any { + file_pkg_grpc_fetch_api_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*GetObjectsFromIndexKeysResponse); i { case 0: return &v.state @@ -1071,7 +1000,7 @@ func file_pkg_grpc_fetch_api_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pkg_grpc_fetch_api_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/grpc/fetch-api.proto b/pkg/grpc/fetch-api.proto index 0feaca1..c1a427e 100644 --- a/pkg/grpc/fetch-api.proto +++ b/pkg/grpc/fetch-api.proto @@ -1,11 +1,12 @@ syntax = "proto3"; -option go_package = "github.com/DIMO-Network/model-garage/pkg/grpc"; +option go_package = "github.com/DIMO-Network/fetch-api/pkg/grpc"; package grpc; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; +import "pkg/grpc/cloudevent.proto"; // FetchService defines the gRPC service for fetching DIMO objects service FetchService { @@ -59,13 +60,6 @@ message SearchOptions { google.protobuf.StringValue optional = 10; } -// DataObject contains the index key and data retrieved from the object. -message DataObject { - // The index key of the object. - string index_key = 1; - // The data retrieved from the object. - bytes data = 2; -} // GetLatestIndexKeyRequest includes search options to filter the events. message GetLatestIndexKeyRequest { @@ -102,7 +96,7 @@ message GetLatestObjectRequest { // GetLatestObjectResponse provides the data retrieved from the latest cloud event. message GetLatestObjectResponse { // The data retrieved from the latest cloud event. - DataObject data_object = 1; + cloudevent.CloudEvent data_object = 1; } // GetObjectsRequest includes search options to filter the events. @@ -117,7 +111,7 @@ message GetObjectsRequest { // GetObjectsResponse provides the list of data retrieved from the objects. message GetObjectsResponse { // The list of data retrieved from the objects. - repeated DataObject data_objects = 1; + repeated cloudevent.CloudEvent cloud_events = 1; } // GetObjectsFromIndexKeysRequest includes the index key to filter the events. @@ -129,5 +123,5 @@ message GetObjectsFromIndexKeysRequest { // GetObjectsFromNameResponse provides the list of data retrieved from the objects. message GetObjectsFromIndexKeysResponse { // The list of data retrieved from the objects. - repeated DataObject data_objects = 1; + repeated cloudevent.CloudEvent cloud_events = 1; } \ No newline at end of file From c8d4aabee91edd9131bd87f83ac40c4e00032a42 Mon Sep 17 00:00:00 2001 From: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:02:55 -0500 Subject: [PATCH 2/9] rename dataObject field --- pkg/grpc/fetch-api.pb.go | 14 +++++++------- pkg/grpc/fetch-api.proto | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/grpc/fetch-api.pb.go b/pkg/grpc/fetch-api.pb.go index dd52393..752c4bd 100644 --- a/pkg/grpc/fetch-api.pb.go +++ b/pkg/grpc/fetch-api.pb.go @@ -413,7 +413,7 @@ type GetLatestObjectResponse struct { unknownFields protoimpl.UnknownFields // The data retrieved from the latest cloud event. - DataObject *CloudEvent `protobuf:"bytes,1,opt,name=data_object,json=dataObject,proto3" json:"data_object,omitempty"` + CloudEvent *CloudEvent `protobuf:"bytes,1,opt,name=cloud_event,json=cloudEvent,proto3" json:"cloud_event,omitempty"` } func (x *GetLatestObjectResponse) Reset() { @@ -448,9 +448,9 @@ func (*GetLatestObjectResponse) Descriptor() ([]byte, []int) { return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{6} } -func (x *GetLatestObjectResponse) GetDataObject() *CloudEvent { +func (x *GetLatestObjectResponse) GetCloudEvent() *CloudEvent { if x != nil { - return x.DataObject + return x.CloudEvent } return nil } @@ -733,10 +733,10 @@ var file_pkg_grpc_fetch_api_proto_rawDesc = []byte{ 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x52, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0b, - 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, + 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, @@ -833,7 +833,7 @@ var file_pkg_grpc_fetch_api_proto_depIdxs = []int32{ 0, // 10: grpc.GetLatestIndexKeyRequest.options:type_name -> grpc.SearchOptions 0, // 11: grpc.GetIndexKeysRequest.options:type_name -> grpc.SearchOptions 0, // 12: grpc.GetLatestObjectRequest.options:type_name -> grpc.SearchOptions - 14, // 13: grpc.GetLatestObjectResponse.data_object:type_name -> cloudevent.CloudEvent + 14, // 13: grpc.GetLatestObjectResponse.cloud_event:type_name -> cloudevent.CloudEvent 0, // 14: grpc.GetObjectsRequest.options:type_name -> grpc.SearchOptions 14, // 15: grpc.GetObjectsResponse.cloud_events:type_name -> cloudevent.CloudEvent 14, // 16: grpc.GetObjectsFromIndexKeysResponse.cloud_events:type_name -> cloudevent.CloudEvent diff --git a/pkg/grpc/fetch-api.proto b/pkg/grpc/fetch-api.proto index c1a427e..9ab31a1 100644 --- a/pkg/grpc/fetch-api.proto +++ b/pkg/grpc/fetch-api.proto @@ -96,7 +96,7 @@ message GetLatestObjectRequest { // GetLatestObjectResponse provides the data retrieved from the latest cloud event. message GetLatestObjectResponse { // The data retrieved from the latest cloud event. - cloudevent.CloudEvent data_object = 1; + cloudevent.CloudEvent cloud_event = 1; } // GetObjectsRequest includes search options to filter the events. From ef6ebcf5f85dc54160fea2cefc2d9fe2400e578e Mon Sep 17 00:00:00 2001 From: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:15:12 -0500 Subject: [PATCH 3/9] Update search options to use cloudevent Header info --- internal/fetch/rpc/rpc.go | 16 ++- pkg/grpc/fetch-api.pb.go | 227 +++++++++++++++++++------------------- pkg/grpc/fetch-api.proto | 8 +- 3 files changed, 128 insertions(+), 123 deletions(-) diff --git a/internal/fetch/rpc/rpc.go b/internal/fetch/rpc/rpc.go index d975935..2b65f8e 100644 --- a/internal/fetch/rpc/rpc.go +++ b/internal/fetch/rpc/rpc.go @@ -11,6 +11,7 @@ import ( "github.com/DIMO-Network/fetch-api/internal/fetch" "github.com/DIMO-Network/fetch-api/pkg/grpc" "github.com/DIMO-Network/model-garage/pkg/cloudevent" + "github.com/DIMO-Network/nameindexer" "github.com/DIMO-Network/nameindexer/pkg/clickhouse/indexrepo" "google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/wrapperspb" @@ -24,7 +25,7 @@ type Server struct { ephemeralBucket string } -// New creates a new Server instance. +// NewServer creates a new Server instance. func NewServer(chConn clickhouse.Conn, objGetter indexrepo.ObjectGetter, cloudEventBucket, ephemeralBucket string) *Server { return &Server{ indexService: indexrepo.New(chConn, objGetter), @@ -83,7 +84,7 @@ func (s *Server) GetLatestObject(ctx context.Context, req *grpc.GetLatestObjectR if err != nil { return nil, fmt.Errorf("failed to get latest object: %w", err) } - return &grpc.GetLatestObjectResponse{DataObject: cloudEventToProto(latestData)}, nil + return &grpc.GetLatestObjectResponse{CloudEvent: cloudEventToProto(latestData)}, nil } // GetObjectsFromIndexKeys translates the gRPC call to the indexrepo type and fetches data for the given options. @@ -122,13 +123,18 @@ func translateSearchOptions(protoOptions *grpc.SearchOptions) indexrepo.SearchOp if protoOptions.GetTimestampAsc() != nil { timestampAsc = protoOptions.GetTimestampAsc().GetValue() } - + var filler *string + if protoOptions.GetType() != nil { + val := protoOptions.GetType().GetValue() + val = nameindexer.CloudTypeToFiller(val) + filler = &val + } return indexrepo.SearchOptions{ After: after, Before: before, TimestampAsc: timestampAsc, - PrimaryFiller: getStringValue(protoOptions.GetPrimaryFiller()), - DataType: getStringValue(protoOptions.GetDataType()), + PrimaryFiller: filler, + DataType: getStringValue(protoOptions.GetDataVersion()), Subject: getStringValue(protoOptions.GetSubject()), SecondaryFiller: getStringValue(protoOptions.GetSecondaryFiller()), Source: getStringValue(protoOptions.GetSource()), diff --git a/pkg/grpc/fetch-api.pb.go b/pkg/grpc/fetch-api.pb.go index 752c4bd..ae7a68d 100644 --- a/pkg/grpc/fetch-api.pb.go +++ b/pkg/grpc/fetch-api.pb.go @@ -35,10 +35,10 @@ type SearchOptions struct { Before *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=before,proto3" json:"before,omitempty"` // Whether to sort results in ascending order by timestamp. TimestampAsc *wrapperspb.BoolValue `protobuf:"bytes,3,opt,name=timestamp_asc,json=timestampAsc,proto3" json:"timestamp_asc,omitempty"` - // Primary filler value used to filter events. - PrimaryFiller *wrapperspb.StringValue `protobuf:"bytes,4,opt,name=primary_filler,json=primaryFiller,proto3" json:"primary_filler,omitempty"` - // Data type to filter events. - DataType *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=data_type,json=dataType,proto3" json:"data_type,omitempty"` + // Type of the event to filter. + Type *wrapperspb.StringValue `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` + // DataVersion of the event to filter. + DataVersion *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=data_version,json=dataVersion,proto3" json:"data_version,omitempty"` // The subject of the event to filter. Subject *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=subject,proto3" json:"subject,omitempty"` // Secondary filler value used to filter events. @@ -104,16 +104,16 @@ func (x *SearchOptions) GetTimestampAsc() *wrapperspb.BoolValue { return nil } -func (x *SearchOptions) GetPrimaryFiller() *wrapperspb.StringValue { +func (x *SearchOptions) GetType() *wrapperspb.StringValue { if x != nil { - return x.PrimaryFiller + return x.Type } return nil } -func (x *SearchOptions) GetDataType() *wrapperspb.StringValue { +func (x *SearchOptions) GetDataVersion() *wrapperspb.StringValue { if x != nil { - return x.DataType + return x.DataVersion } return nil } @@ -670,7 +670,7 @@ var file_pkg_grpc_fetch_api_proto_rawDesc = []byte{ 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe1, 0x04, 0x0a, + 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd4, 0x04, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, @@ -682,111 +682,110 @@ var file_pkg_grpc_fetch_api_proto_rawDesc = []byte{ 0x70, 0x5f, 0x61, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x41, 0x73, 0x63, 0x12, 0x43, 0x0a, 0x0e, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, - 0x5f, 0x66, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x6d, 0x70, 0x41, 0x73, 0x63, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x70, 0x72, 0x69, - 0x6d, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x09, 0x64, 0x61, - 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, - 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x47, 0x0a, - 0x10, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x6c, 0x65, - 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, - 0x46, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x08, - 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, - 0x22, 0x49, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x38, 0x0a, 0x19, 0x47, - 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x4b, 0x65, 0x79, 0x22, 0x5a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x22, 0x35, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x47, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x22, 0x52, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0b, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, - 0x4f, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x22, 0x3f, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, - 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, - 0x73, 0x22, 0x5c, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, - 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x32, - 0xa4, 0x03, 0x0a, 0x0c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x54, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x1e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, - 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, - 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, - 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, - 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, - 0x0a, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, - 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x61, 0x74, + 0x61, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x12, 0x47, 0x0a, 0x10, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x69, + 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x06, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x38, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x22, 0x49, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x38, + 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x22, 0x5a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x22, 0x35, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x47, 0x0a, 0x16, 0x47, + 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x52, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x37, 0x0a, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x22, 0x4f, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x22, 0x3f, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x2f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, + 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x4b, 0x65, 0x79, 0x73, 0x22, 0x5c, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x32, 0xa4, 0x03, 0x0a, 0x0c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x1e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x47, 0x65, 0x74, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x3f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x17, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, + 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x66, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, + 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x24, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, + 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -823,8 +822,8 @@ var file_pkg_grpc_fetch_api_proto_depIdxs = []int32{ 11, // 0: grpc.SearchOptions.after:type_name -> google.protobuf.Timestamp 11, // 1: grpc.SearchOptions.before:type_name -> google.protobuf.Timestamp 12, // 2: grpc.SearchOptions.timestamp_asc:type_name -> google.protobuf.BoolValue - 13, // 3: grpc.SearchOptions.primary_filler:type_name -> google.protobuf.StringValue - 13, // 4: grpc.SearchOptions.data_type:type_name -> google.protobuf.StringValue + 13, // 3: grpc.SearchOptions.type:type_name -> google.protobuf.StringValue + 13, // 4: grpc.SearchOptions.data_version:type_name -> google.protobuf.StringValue 13, // 5: grpc.SearchOptions.subject:type_name -> google.protobuf.StringValue 13, // 6: grpc.SearchOptions.secondary_filler:type_name -> google.protobuf.StringValue 13, // 7: grpc.SearchOptions.source:type_name -> google.protobuf.StringValue diff --git a/pkg/grpc/fetch-api.proto b/pkg/grpc/fetch-api.proto index 9ab31a1..e9376fa 100644 --- a/pkg/grpc/fetch-api.proto +++ b/pkg/grpc/fetch-api.proto @@ -38,11 +38,11 @@ message SearchOptions { // Whether to sort results in ascending order by timestamp. google.protobuf.BoolValue timestamp_asc = 3; - // Primary filler value used to filter events. - google.protobuf.StringValue primary_filler = 4; + // Type of the event to filter. + google.protobuf.StringValue type = 4; - // Data type to filter events. - google.protobuf.StringValue data_type = 5; + // DataVersion of the event to filter. + google.protobuf.StringValue data_version = 5; // The subject of the event to filter. google.protobuf.StringValue subject = 6; From fdb80a6b6a823d5266e3b47f43d6f2b9e001cb2c Mon Sep 17 00:00:00 2001 From: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:19:58 -0500 Subject: [PATCH 4/9] Update search options --- go.mod | 2 +- go.sum | 2 ++ internal/fetch/httphandler/httphandler.go | 21 ++++++--------- internal/fetch/rpc/rpc.go | 33 +++++++++-------------- pkg/grpc/fetch-api.proto | 3 --- 5 files changed, 24 insertions(+), 37 deletions(-) diff --git a/go.mod b/go.mod index 4c337d2..5a76df6 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ClickHouse/clickhouse-go/v2 v2.30.0 github.com/DIMO-Network/clickhouse-infra v0.0.3 github.com/DIMO-Network/model-garage v0.4.2 - github.com/DIMO-Network/nameindexer v0.0.12-0.20241126175909-94075d731767 + github.com/DIMO-Network/nameindexer v0.0.12-0.20241127145606-0297cf40149c github.com/DIMO-Network/shared v0.11.1 github.com/aws/aws-sdk-go-v2 v1.32.2 github.com/aws/aws-sdk-go-v2/credentials v1.17.27 diff --git a/go.sum b/go.sum index 4e17221..891eed8 100644 --- a/go.sum +++ b/go.sum @@ -76,6 +76,8 @@ github.com/DIMO-Network/model-garage v0.4.2 h1:TF+RNC1n1Y58QSdzmKaf5REixdariAP4t github.com/DIMO-Network/model-garage v0.4.2/go.mod h1:SXaBHFFARooOEoaV1wFaOC1K0LMt0bovkILsFXoUQTg= github.com/DIMO-Network/nameindexer v0.0.12-0.20241126175909-94075d731767 h1:KZc2t4eIFuIwxztUstDxeAu87FKL4QQrNEbkO0VKQDU= github.com/DIMO-Network/nameindexer v0.0.12-0.20241126175909-94075d731767/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= +github.com/DIMO-Network/nameindexer v0.0.12-0.20241127145606-0297cf40149c h1:ebCezS1Dp2a+CFdJDQqJ6Zjv5GJUDHhD+l6yEwOWLyg= +github.com/DIMO-Network/nameindexer v0.0.12-0.20241127145606-0297cf40149c/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= github.com/DIMO-Network/shared v0.11.1 h1:LpI2rROKjrBo6KO76sU3dZDvSv4YbQ4XUBEC4P5NosM= github.com/DIMO-Network/shared v0.11.1/go.mod h1:lm7rUB5i7Jx7t3EomtCwep0aC+sB+nlYYTJkTdUeKHM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= diff --git a/internal/fetch/httphandler/httphandler.go b/internal/fetch/httphandler/httphandler.go index ad67924..aa6ec32 100644 --- a/internal/fetch/httphandler/httphandler.go +++ b/internal/fetch/httphandler/httphandler.go @@ -50,20 +50,15 @@ type searchParams struct { Limit int `query:"limit"` } -func (s *searchParams) toSearchOptions(subject cloudevent.NFTDID) indexrepo.SearchOptions { - var primaryFiller *string - if s.Type != nil { - filler := nameindexer.CloudTypeToFiller(*s.Type) - primaryFiller = &filler - } +func (s *searchParams) toSearchOptions(subject cloudevent.NFTDID) indexrepo.RawSearchOptions { encodedSubject := nameindexer.EncodeNFTDID(subject) - return indexrepo.SearchOptions{ - Subject: &encodedSubject, - PrimaryFiller: primaryFiller, - Source: s.Source, - Producer: s.Producer, - Before: s.Before, - After: s.After, + return indexrepo.RawSearchOptions{ + Subject: &encodedSubject, + Type: s.Type, + Source: s.Source, + Producer: s.Producer, + Before: s.Before, + After: s.After, } } diff --git a/internal/fetch/rpc/rpc.go b/internal/fetch/rpc/rpc.go index 2b65f8e..fbdf279 100644 --- a/internal/fetch/rpc/rpc.go +++ b/internal/fetch/rpc/rpc.go @@ -11,7 +11,6 @@ import ( "github.com/DIMO-Network/fetch-api/internal/fetch" "github.com/DIMO-Network/fetch-api/pkg/grpc" "github.com/DIMO-Network/model-garage/pkg/cloudevent" - "github.com/DIMO-Network/nameindexer" "github.com/DIMO-Network/nameindexer/pkg/clickhouse/indexrepo" "google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/wrapperspb" @@ -101,9 +100,9 @@ func (s *Server) GetObjectsFromIndexKeys(ctx context.Context, req *grpc.GetObjec } // translateProtoToSearchOptions translates a SearchOptions proto message to the Go SearchOptions type. -func translateSearchOptions(protoOptions *grpc.SearchOptions) indexrepo.SearchOptions { +func translateSearchOptions(protoOptions *grpc.SearchOptions) indexrepo.RawSearchOptions { if protoOptions == nil { - return indexrepo.SearchOptions{} + return indexrepo.RawSearchOptions{} } // Converting after timestamp from proto to Go time @@ -123,23 +122,17 @@ func translateSearchOptions(protoOptions *grpc.SearchOptions) indexrepo.SearchOp if protoOptions.GetTimestampAsc() != nil { timestampAsc = protoOptions.GetTimestampAsc().GetValue() } - var filler *string - if protoOptions.GetType() != nil { - val := protoOptions.GetType().GetValue() - val = nameindexer.CloudTypeToFiller(val) - filler = &val - } - return indexrepo.SearchOptions{ - After: after, - Before: before, - TimestampAsc: timestampAsc, - PrimaryFiller: filler, - DataType: getStringValue(protoOptions.GetDataVersion()), - Subject: getStringValue(protoOptions.GetSubject()), - SecondaryFiller: getStringValue(protoOptions.GetSecondaryFiller()), - Source: getStringValue(protoOptions.GetSource()), - Producer: getStringValue(protoOptions.GetProducer()), - Optional: getStringValue(protoOptions.GetOptional()), + + return indexrepo.RawSearchOptions{ + After: after, + Before: before, + TimestampAsc: timestampAsc, + Type: getStringValue(protoOptions.GetType()), + DataVersion: getStringValue(protoOptions.GetDataVersion()), + Subject: getStringValue(protoOptions.GetSubject()), + Source: getStringValue(protoOptions.GetSource()), + Producer: getStringValue(protoOptions.GetProducer()), + Optional: getStringValue(protoOptions.GetOptional()), } } diff --git a/pkg/grpc/fetch-api.proto b/pkg/grpc/fetch-api.proto index e9376fa..b3f6f1e 100644 --- a/pkg/grpc/fetch-api.proto +++ b/pkg/grpc/fetch-api.proto @@ -47,9 +47,6 @@ message SearchOptions { // The subject of the event to filter. google.protobuf.StringValue subject = 6; - // Secondary filler value used to filter events. - google.protobuf.StringValue secondary_filler = 7; - // The source identifier responsible for creating the data. google.protobuf.StringValue source = 8; From 3c98086d4b925227603eafd2ffb620e70b4513a8 Mon Sep 17 00:00:00 2001 From: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com> Date: Wed, 27 Nov 2024 14:35:19 -0500 Subject: [PATCH 5/9] Make generate --- pkg/grpc/fetch-api.pb.go | 240 ++++++++++++++++++--------------------- 1 file changed, 113 insertions(+), 127 deletions(-) diff --git a/pkg/grpc/fetch-api.pb.go b/pkg/grpc/fetch-api.pb.go index ae7a68d..d355d7e 100644 --- a/pkg/grpc/fetch-api.pb.go +++ b/pkg/grpc/fetch-api.pb.go @@ -41,8 +41,6 @@ type SearchOptions struct { DataVersion *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=data_version,json=dataVersion,proto3" json:"data_version,omitempty"` // The subject of the event to filter. Subject *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=subject,proto3" json:"subject,omitempty"` - // Secondary filler value used to filter events. - SecondaryFiller *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=secondary_filler,json=secondaryFiller,proto3" json:"secondary_filler,omitempty"` // The source identifier responsible for creating the data. Source *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=source,proto3" json:"source,omitempty"` // The producer of the data, source entity responsible for creating the data. @@ -125,13 +123,6 @@ func (x *SearchOptions) GetSubject() *wrapperspb.StringValue { return nil } -func (x *SearchOptions) GetSecondaryFiller() *wrapperspb.StringValue { - if x != nil { - return x.SecondaryFiller - } - return nil -} - func (x *SearchOptions) GetSource() *wrapperspb.StringValue { if x != nil { return x.Source @@ -670,7 +661,7 @@ var file_pkg_grpc_fetch_api_proto_rawDesc = []byte{ 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd4, 0x04, 0x0a, + 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8b, 0x04, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, @@ -693,99 +684,95 @@ var file_pkg_grpc_fetch_api_proto_rawDesc = []byte{ 0x65, 0x63, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x12, 0x47, 0x0a, 0x10, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x69, - 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, - 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x06, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x38, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x61, 0x6c, 0x22, 0x49, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x38, - 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x22, 0x5a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, - 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x22, 0x35, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x47, 0x0a, 0x16, 0x47, + 0x12, 0x34, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, + 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, + 0x12, 0x38, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0x49, 0x0a, 0x18, 0x47, 0x65, + 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x38, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x22, + 0x5a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x35, 0x0a, 0x14, 0x47, + 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, + 0x79, 0x73, 0x22, 0x47, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x52, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x52, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x37, 0x0a, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x22, 0x4f, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x22, 0x3f, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, - 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x4b, 0x65, 0x79, 0x73, 0x22, 0x5c, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x32, 0xa4, 0x03, 0x0a, 0x0c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x1e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x47, 0x65, 0x74, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, - 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x17, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, + 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x4f, 0x0a, 0x12, 0x47, 0x65, 0x74, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x3f, 0x0a, 0x1e, 0x47, 0x65, + 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x5c, 0x0a, 0x1f, 0x47, + 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, + 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x32, 0xa4, 0x03, 0x0a, 0x0c, 0x46, 0x65, + 0x74, 0x63, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x11, 0x47, 0x65, + 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, + 0x1e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x45, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, + 0x12, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, - 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x66, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, - 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x24, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, - 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, + 0x65, 0x79, 0x73, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, + 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, + 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x66, 0x65, 0x74, 0x63, + 0x68, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -825,32 +812,31 @@ var file_pkg_grpc_fetch_api_proto_depIdxs = []int32{ 13, // 3: grpc.SearchOptions.type:type_name -> google.protobuf.StringValue 13, // 4: grpc.SearchOptions.data_version:type_name -> google.protobuf.StringValue 13, // 5: grpc.SearchOptions.subject:type_name -> google.protobuf.StringValue - 13, // 6: grpc.SearchOptions.secondary_filler:type_name -> google.protobuf.StringValue - 13, // 7: grpc.SearchOptions.source:type_name -> google.protobuf.StringValue - 13, // 8: grpc.SearchOptions.producer:type_name -> google.protobuf.StringValue - 13, // 9: grpc.SearchOptions.optional:type_name -> google.protobuf.StringValue - 0, // 10: grpc.GetLatestIndexKeyRequest.options:type_name -> grpc.SearchOptions - 0, // 11: grpc.GetIndexKeysRequest.options:type_name -> grpc.SearchOptions - 0, // 12: grpc.GetLatestObjectRequest.options:type_name -> grpc.SearchOptions - 14, // 13: grpc.GetLatestObjectResponse.cloud_event:type_name -> cloudevent.CloudEvent - 0, // 14: grpc.GetObjectsRequest.options:type_name -> grpc.SearchOptions - 14, // 15: grpc.GetObjectsResponse.cloud_events:type_name -> cloudevent.CloudEvent - 14, // 16: grpc.GetObjectsFromIndexKeysResponse.cloud_events:type_name -> cloudevent.CloudEvent - 1, // 17: grpc.FetchService.GetLatestIndexKey:input_type -> grpc.GetLatestIndexKeyRequest - 3, // 18: grpc.FetchService.GetIndexKeys:input_type -> grpc.GetIndexKeysRequest - 5, // 19: grpc.FetchService.GetLatestObject:input_type -> grpc.GetLatestObjectRequest - 7, // 20: grpc.FetchService.GetObjects:input_type -> grpc.GetObjectsRequest - 9, // 21: grpc.FetchService.GetObjectsFromIndexKeys:input_type -> grpc.GetObjectsFromIndexKeysRequest - 2, // 22: grpc.FetchService.GetLatestIndexKey:output_type -> grpc.GetLatestIndexKeyResponse - 4, // 23: grpc.FetchService.GetIndexKeys:output_type -> grpc.GetIndexKeysResponse - 6, // 24: grpc.FetchService.GetLatestObject:output_type -> grpc.GetLatestObjectResponse - 8, // 25: grpc.FetchService.GetObjects:output_type -> grpc.GetObjectsResponse - 10, // 26: grpc.FetchService.GetObjectsFromIndexKeys:output_type -> grpc.GetObjectsFromIndexKeysResponse - 22, // [22:27] is the sub-list for method output_type - 17, // [17:22] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 13, // 6: grpc.SearchOptions.source:type_name -> google.protobuf.StringValue + 13, // 7: grpc.SearchOptions.producer:type_name -> google.protobuf.StringValue + 13, // 8: grpc.SearchOptions.optional:type_name -> google.protobuf.StringValue + 0, // 9: grpc.GetLatestIndexKeyRequest.options:type_name -> grpc.SearchOptions + 0, // 10: grpc.GetIndexKeysRequest.options:type_name -> grpc.SearchOptions + 0, // 11: grpc.GetLatestObjectRequest.options:type_name -> grpc.SearchOptions + 14, // 12: grpc.GetLatestObjectResponse.cloud_event:type_name -> cloudevent.CloudEvent + 0, // 13: grpc.GetObjectsRequest.options:type_name -> grpc.SearchOptions + 14, // 14: grpc.GetObjectsResponse.cloud_events:type_name -> cloudevent.CloudEvent + 14, // 15: grpc.GetObjectsFromIndexKeysResponse.cloud_events:type_name -> cloudevent.CloudEvent + 1, // 16: grpc.FetchService.GetLatestIndexKey:input_type -> grpc.GetLatestIndexKeyRequest + 3, // 17: grpc.FetchService.GetIndexKeys:input_type -> grpc.GetIndexKeysRequest + 5, // 18: grpc.FetchService.GetLatestObject:input_type -> grpc.GetLatestObjectRequest + 7, // 19: grpc.FetchService.GetObjects:input_type -> grpc.GetObjectsRequest + 9, // 20: grpc.FetchService.GetObjectsFromIndexKeys:input_type -> grpc.GetObjectsFromIndexKeysRequest + 2, // 21: grpc.FetchService.GetLatestIndexKey:output_type -> grpc.GetLatestIndexKeyResponse + 4, // 22: grpc.FetchService.GetIndexKeys:output_type -> grpc.GetIndexKeysResponse + 6, // 23: grpc.FetchService.GetLatestObject:output_type -> grpc.GetLatestObjectResponse + 8, // 24: grpc.FetchService.GetObjects:output_type -> grpc.GetObjectsResponse + 10, // 25: grpc.FetchService.GetObjectsFromIndexKeys:output_type -> grpc.GetObjectsFromIndexKeysResponse + 21, // [21:26] is the sub-list for method output_type + 16, // [16:21] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_pkg_grpc_fetch_api_proto_init() } From fc3e9efcacf45029f1815ee1949645263f36b5f1 Mon Sep 17 00:00:00 2001 From: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com> Date: Wed, 27 Nov 2024 20:33:39 -0500 Subject: [PATCH 6/9] Update names and params to match indexrepo --- docs/docs.go | 62 ++- docs/swagger.json | 62 ++- docs/swagger.yaml | 63 ++- go.mod | 2 +- go.sum | 6 +- internal/fetch/fetch.go | 25 +- internal/fetch/httphandler/httphandler.go | 27 +- internal/fetch/rpc/rpc.go | 100 ++-- pkg/grpc/cloudevent.proto | 2 +- pkg/grpc/fetch-api.pb.go | 624 ++++++++++++---------- pkg/grpc/fetch-api.proto | 75 +-- pkg/grpc/fetch-api_grpc.pb.go | 170 +++--- 12 files changed, 724 insertions(+), 494 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 2849d1b..e5c1fc6 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -95,7 +95,10 @@ const docTemplate = `{ "200": { "description": "Returns list of index keys", "schema": { - "$ref": "#/definitions/internal_fetch_httphandler.indexKeysResponse" + "type": "array", + "items": { + "$ref": "#/definitions/indexrepo.CloudEventMetadata" + } } }, "400": { @@ -175,7 +178,7 @@ const docTemplate = `{ "200": { "description": "Returns the latest index key", "schema": { - "$ref": "#/definitions/internal_fetch_httphandler.indexKeyResponse" + "$ref": "#/definitions/indexrepo.CloudEventMetadata" } }, "400": { @@ -416,22 +419,51 @@ const docTemplate = `{ } } }, - "internal_fetch_httphandler.indexKeyResponse": { + "indexrepo.CloudEventMetadata": { "type": "object", "properties": { - "indexKey": { + "datacontenttype": { + "description": "DataContentType is an optional MIME type for the data field. We almost\nalways serialize to JSON and in that case this field is implicitly\n\"application/json\".", + "type": "string" + }, + "dataschema": { + "description": "DataSchema is an optional URI pointing to a schema for the data field.", + "type": "string" + }, + "dataversion": { + "description": "DataVersion is the version of the data type.", + "type": "string" + }, + "id": { + "description": "ID is an identifier for the event. The combination of ID and Source must\nbe unique.", + "type": "string" + }, + "key": { + "type": "string" + }, + "producer": { + "description": "Producer is a specific instance, process or device that creates the data structure describing the CloudEvent.", + "type": "string" + }, + "source": { + "description": "Source is the context in which the event happened. In a distributed system it might consist of multiple Producers.", + "type": "string" + }, + "specversion": { + "description": "SpecVersion is the version of CloudEvents specification used.\nThis is always hardcoded \"1.0\".", + "type": "string" + }, + "subject": { + "description": "Subject is an optional field identifying the subject of the event within\nthe context of the event producer. In practice, we always set this.", + "type": "string" + }, + "time": { + "description": "Time is an optional field giving the time at which the event occurred. In\npractice, we always set this.", + "type": "string" + }, + "type": { + "description": "Type describes the type of event. It should generally be a reverse-DNS\nname.", "type": "string" - } - } - }, - "internal_fetch_httphandler.indexKeysResponse": { - "type": "object", - "properties": { - "indexKeys": { - "type": "array", - "items": { - "type": "string" - } } } } diff --git a/docs/swagger.json b/docs/swagger.json index 63f82a2..84f1c89 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -86,7 +86,10 @@ "200": { "description": "Returns list of index keys", "schema": { - "$ref": "#/definitions/internal_fetch_httphandler.indexKeysResponse" + "type": "array", + "items": { + "$ref": "#/definitions/indexrepo.CloudEventMetadata" + } } }, "400": { @@ -166,7 +169,7 @@ "200": { "description": "Returns the latest index key", "schema": { - "$ref": "#/definitions/internal_fetch_httphandler.indexKeyResponse" + "$ref": "#/definitions/indexrepo.CloudEventMetadata" } }, "400": { @@ -407,22 +410,51 @@ } } }, - "internal_fetch_httphandler.indexKeyResponse": { + "indexrepo.CloudEventMetadata": { "type": "object", "properties": { - "indexKey": { + "datacontenttype": { + "description": "DataContentType is an optional MIME type for the data field. We almost\nalways serialize to JSON and in that case this field is implicitly\n\"application/json\".", + "type": "string" + }, + "dataschema": { + "description": "DataSchema is an optional URI pointing to a schema for the data field.", + "type": "string" + }, + "dataversion": { + "description": "DataVersion is the version of the data type.", + "type": "string" + }, + "id": { + "description": "ID is an identifier for the event. The combination of ID and Source must\nbe unique.", + "type": "string" + }, + "key": { + "type": "string" + }, + "producer": { + "description": "Producer is a specific instance, process or device that creates the data structure describing the CloudEvent.", + "type": "string" + }, + "source": { + "description": "Source is the context in which the event happened. In a distributed system it might consist of multiple Producers.", + "type": "string" + }, + "specversion": { + "description": "SpecVersion is the version of CloudEvents specification used.\nThis is always hardcoded \"1.0\".", + "type": "string" + }, + "subject": { + "description": "Subject is an optional field identifying the subject of the event within\nthe context of the event producer. In practice, we always set this.", + "type": "string" + }, + "time": { + "description": "Time is an optional field giving the time at which the event occurred. In\npractice, we always set this.", + "type": "string" + }, + "type": { + "description": "Type describes the type of event. It should generally be a reverse-DNS\nname.", "type": "string" - } - } - }, - "internal_fetch_httphandler.indexKeysResponse": { - "type": "object", - "properties": { - "indexKeys": { - "type": "array", - "items": { - "type": "string" - } } } } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 5748041..2f9a154 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -53,17 +53,56 @@ definitions: name. type: string type: object - internal_fetch_httphandler.indexKeyResponse: + indexrepo.CloudEventMetadata: properties: - indexKey: + datacontenttype: + description: |- + DataContentType is an optional MIME type for the data field. We almost + always serialize to JSON and in that case this field is implicitly + "application/json". + type: string + dataschema: + description: DataSchema is an optional URI pointing to a schema for the data + field. + type: string + dataversion: + description: DataVersion is the version of the data type. + type: string + id: + description: |- + ID is an identifier for the event. The combination of ID and Source must + be unique. + type: string + key: + type: string + producer: + description: Producer is a specific instance, process or device that creates + the data structure describing the CloudEvent. + type: string + source: + description: Source is the context in which the event happened. In a distributed + system it might consist of multiple Producers. + type: string + specversion: + description: |- + SpecVersion is the version of CloudEvents specification used. + This is always hardcoded "1.0". + type: string + subject: + description: |- + Subject is an optional field identifying the subject of the event within + the context of the event producer. In practice, we always set this. + type: string + time: + description: |- + Time is an optional field giving the time at which the event occurred. In + practice, we always set this. + type: string + type: + description: |- + Type describes the type of event. It should generally be a reverse-DNS + name. type: string - type: object - internal_fetch_httphandler.indexKeysResponse: - properties: - indexKeys: - items: - type: string - type: array type: object info: contact: {} @@ -121,7 +160,9 @@ paths: "200": description: Returns list of index keys schema: - $ref: '#/definitions/internal_fetch_httphandler.indexKeysResponse' + items: + $ref: '#/definitions/indexrepo.CloudEventMetadata' + type: array "400": description: Invalid request schema: @@ -173,7 +214,7 @@ paths: "200": description: Returns the latest index key schema: - $ref: '#/definitions/internal_fetch_httphandler.indexKeyResponse' + $ref: '#/definitions/indexrepo.CloudEventMetadata' "400": description: Invalid request schema: diff --git a/go.mod b/go.mod index 5a76df6..5aed1b1 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ClickHouse/clickhouse-go/v2 v2.30.0 github.com/DIMO-Network/clickhouse-infra v0.0.3 github.com/DIMO-Network/model-garage v0.4.2 - github.com/DIMO-Network/nameindexer v0.0.12-0.20241127145606-0297cf40149c + github.com/DIMO-Network/nameindexer v0.0.12-0.20241127214708-a71ed3d9f0c6 github.com/DIMO-Network/shared v0.11.1 github.com/aws/aws-sdk-go-v2 v1.32.2 github.com/aws/aws-sdk-go-v2/credentials v1.17.27 diff --git a/go.sum b/go.sum index 891eed8..d01dfff 100644 --- a/go.sum +++ b/go.sum @@ -74,10 +74,8 @@ github.com/DIMO-Network/clickhouse-infra v0.0.3 h1:B6/4IY9IxLcyydET14IjHUT+A5SDE github.com/DIMO-Network/clickhouse-infra v0.0.3/go.mod h1:NtpQ1btkPzebDvpYYygeqiiBmJ/q5oJb/T/JWzUVRlk= github.com/DIMO-Network/model-garage v0.4.2 h1:TF+RNC1n1Y58QSdzmKaf5REixdariAP4tqHihzjSe70= github.com/DIMO-Network/model-garage v0.4.2/go.mod h1:SXaBHFFARooOEoaV1wFaOC1K0LMt0bovkILsFXoUQTg= -github.com/DIMO-Network/nameindexer v0.0.12-0.20241126175909-94075d731767 h1:KZc2t4eIFuIwxztUstDxeAu87FKL4QQrNEbkO0VKQDU= -github.com/DIMO-Network/nameindexer v0.0.12-0.20241126175909-94075d731767/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= -github.com/DIMO-Network/nameindexer v0.0.12-0.20241127145606-0297cf40149c h1:ebCezS1Dp2a+CFdJDQqJ6Zjv5GJUDHhD+l6yEwOWLyg= -github.com/DIMO-Network/nameindexer v0.0.12-0.20241127145606-0297cf40149c/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= +github.com/DIMO-Network/nameindexer v0.0.12-0.20241127214708-a71ed3d9f0c6 h1:DGNKbmJCWEtrwPOn9c7D1RmUJSB2wU0uAPovoNB0NmQ= +github.com/DIMO-Network/nameindexer v0.0.12-0.20241127214708-a71ed3d9f0c6/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= github.com/DIMO-Network/shared v0.11.1 h1:LpI2rROKjrBo6KO76sU3dZDvSv4YbQ4XUBEC4P5NosM= github.com/DIMO-Network/shared v0.11.1/go.mod h1:lm7rUB5i7Jx7t3EomtCwep0aC+sB+nlYYTJkTdUeKHM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= diff --git a/internal/fetch/fetch.go b/internal/fetch/fetch.go index 25f3000..9ffb85a 100644 --- a/internal/fetch/fetch.go +++ b/internal/fetch/fetch.go @@ -12,11 +12,24 @@ import ( "github.com/aws/aws-sdk-go-v2/service/s3/types" ) -// GetObjectsFromIndexs gets objects from the index service by trying to get them from each bucket in the list returning the first successful result. -func GetObjectsFromIndexs(ctx context.Context, idxSvc *indexrepo.Service, indexKeys []string, buckets []string) ([]cloudevent.CloudEvent[json.RawMessage], error) { +// GetCloudEventsFromKeys gets objects from the index service by trying to get them from each bucket in the list returning the first successful result. +func GetCloudEventsFromKeys(ctx context.Context, idxSvc *indexrepo.Service, indexKeys []string, buckets []string) ([]cloudevent.CloudEvent[json.RawMessage], error) { dataObjects := make([]cloudevent.CloudEvent[json.RawMessage], 0, len(indexKeys)) for _, key := range indexKeys { - obj, err := GetObjectFromIndex(ctx, idxSvc, key, buckets) + obj, err := GetCloudEventFromKey(ctx, idxSvc, key, buckets) + if err != nil { + return nil, fmt.Errorf("failed to get object: %w", err) + } + dataObjects = append(dataObjects, obj) + } + return dataObjects, nil +} + +// GetObjectsFromIndexs gets objects from the index service by trying to get them from each bucket in the list returning the first successful result. +func ListCloudEventsFromMetadata(ctx context.Context, idxSvc *indexrepo.Service, metadataList []indexrepo.CloudEventMetadata, buckets []string) ([]cloudevent.CloudEvent[json.RawMessage], error) { + dataObjects := make([]cloudevent.CloudEvent[json.RawMessage], 0, len(metadataList)) + for _, metaData := range metadataList { + obj, err := GetCloudEventFromKey(ctx, idxSvc, metaData.Key, buckets) if err != nil { return nil, fmt.Errorf("failed to get object: %w", err) } @@ -25,13 +38,13 @@ func GetObjectsFromIndexs(ctx context.Context, idxSvc *indexrepo.Service, indexK return dataObjects, nil } -// GetObjectFromIndex gets an object from the index service by trying to get it from each bucket in the list returning the first successful result. -func GetObjectFromIndex(ctx context.Context, idxSvc *indexrepo.Service, indexKeys string, buckets []string) (cloudevent.CloudEvent[json.RawMessage], error) { +// GetCloudEventFromKey gets an object from the index service by trying to get it from each bucket in the list returning the first successful result. +func GetCloudEventFromKey(ctx context.Context, idxSvc *indexrepo.Service, indexKeys string, buckets []string) (cloudevent.CloudEvent[json.RawMessage], error) { var obj cloudevent.CloudEvent[json.RawMessage] var err error // Try to get the object from each bucket in the list for _, bucket := range buckets { - obj, err = idxSvc.GetObjectFromIndex(ctx, indexKeys, bucket) + obj, err = idxSvc.GetCloudEventFromKey(ctx, indexKeys, bucket) if err != nil { notFoundErr := &types.NoSuchKey{} if errors.As(err, ¬FoundErr) { diff --git a/internal/fetch/httphandler/httphandler.go b/internal/fetch/httphandler/httphandler.go index aa6ec32..688d477 100644 --- a/internal/fetch/httphandler/httphandler.go +++ b/internal/fetch/httphandler/httphandler.go @@ -34,13 +34,6 @@ type Handler struct { logger *zerolog.Logger } -type indexKeysResponse struct { - IndexKeys []string `json:"indexKeys"` -} -type indexKeyResponse struct { - IndexKey string `json:"indexKey"` -} - type searchParams struct { Type *string `query:"type"` Source *string `query:"source"` @@ -86,7 +79,7 @@ func NewHandler(logger *zerolog.Logger, chConn clickhouse.Conn, s3Client *s3.Cli // @Produce json // @Param params query searchParams false "Search parameters" // @Param tokenId path string true "Token ID" -// @Success 200 {object} indexKeyResponse "Returns the latest index key" +// @Success 200 {object} indexrepo.CloudEventMetadata "Returns the latest index key" // @Failure 400 {object} map[string]string "Invalid request" // @Failure 500 {object} map[string]string "Server error" // @Router /v1/vehicle/latest-index-key/{tokenId} [get] @@ -105,12 +98,12 @@ func (h *Handler) GetLatestIndexKey(fCtx *fiber.Ctx) error { opts := params.toSearchOptions(cloudevent.NFTDID{ChainID: h.chainID, ContractAddress: h.vehicleAddr, TokenID: uint32(uTokenID)}) - indexKey, err := h.indexService.GetLatestIndexKey(fCtx.Context(), opts) + metadata, err := h.indexService.GetLatestMetadataFromRaw(fCtx.Context(), opts) if err != nil { return handleDBError(err, h.logger) } - return fCtx.JSON(indexKeyResponse{IndexKey: indexKey}) + return fCtx.JSON(metadata) } // GetIndexKeys handles requests for multiple index keys @@ -121,7 +114,7 @@ func (h *Handler) GetLatestIndexKey(fCtx *fiber.Ctx) error { // @Produce json // @Param params query searchParams false "Search parameters" // @Param tokenId path string true "Token ID" -// @Success 200 {object} indexKeysResponse "Returns list of index keys" +// @Success 200 {object} []indexrepo.CloudEventMetadata "Returns list of index keys" // @Failure 400 {object} map[string]string "Invalid request" // @Failure 500 {object} map[string]string "Server error" // @Router /v1/vehicle/index-keys/{tokenId} [get] @@ -140,12 +133,12 @@ func (h *Handler) GetIndexKeys(fCtx *fiber.Ctx) error { opts := params.toSearchOptions(cloudevent.NFTDID{ChainID: h.chainID, ContractAddress: h.vehicleAddr, TokenID: uint32(uTokenID)}) - indexKeys, err := h.indexService.GetIndexKeys(fCtx.Context(), params.Limit, opts) + metaList, err := h.indexService.ListMetadataFromRaw(fCtx.Context(), params.Limit, opts) if err != nil { return handleDBError(err, h.logger) } - return fCtx.JSON(indexKeysResponse{IndexKeys: indexKeys}) + return fCtx.JSON(metaList) } // GetObjects handles requests for multiple objects @@ -175,11 +168,11 @@ func (h *Handler) GetObjects(fCtx *fiber.Ctx) error { opts := params.toSearchOptions(cloudevent.NFTDID{ChainID: h.chainID, ContractAddress: h.vehicleAddr, TokenID: uint32(uTokenID)}) - indexKeys, err := h.indexService.GetIndexKeys(fCtx.Context(), params.Limit, opts) + metaList, err := h.indexService.ListMetadataFromRaw(fCtx.Context(), params.Limit, opts) if err != nil { return handleDBError(err, h.logger) } - data, err := fetch.GetObjectsFromIndexs(fCtx.Context(), h.indexService, indexKeys, []string{h.cloudEventBucket, h.ephemeralBucket}) + data, err := fetch.ListCloudEventsFromMetadata(fCtx.Context(), h.indexService, metaList, []string{h.cloudEventBucket, h.ephemeralBucket}) if err != nil { return handleDBError(err, h.logger) } @@ -213,11 +206,11 @@ func (h *Handler) GetLatestObject(fCtx *fiber.Ctx) error { } opts := params.toSearchOptions(cloudevent.NFTDID{ChainID: h.chainID, ContractAddress: h.vehicleAddr, TokenID: uint32(uTokenID)}) - indexKey, err := h.indexService.GetLatestIndexKey(fCtx.Context(), opts) + metadata, err := h.indexService.GetLatestMetadataFromRaw(fCtx.Context(), opts) if err != nil { return handleDBError(err, h.logger) } - data, err := fetch.GetObjectFromIndex(fCtx.Context(), h.indexService, indexKey, []string{h.cloudEventBucket, h.ephemeralBucket}) + data, err := fetch.GetCloudEventFromKey(fCtx.Context(), h.indexService, metadata.Key, []string{h.cloudEventBucket, h.ephemeralBucket}) if err != nil { return handleDBError(err, h.logger) } diff --git a/internal/fetch/rpc/rpc.go b/internal/fetch/rpc/rpc.go index fbdf279..dcf18e0 100644 --- a/internal/fetch/rpc/rpc.go +++ b/internal/fetch/rpc/rpc.go @@ -33,34 +33,46 @@ func NewServer(chConn clickhouse.Conn, objGetter indexrepo.ObjectGetter, cloudEv } } -// GetLatestIndexKey translates the gRPC call to the indexrepo type and returns the latest index key for the given options. -func (s *Server) GetLatestIndexKey(ctx context.Context, req *grpc.GetLatestIndexKeyRequest) (*grpc.GetLatestIndexKeyResponse, error) { +// GetLatestMetadata translates the gRPC call to the indexrepo type and returns the latest metadata for the given options. +func (s *Server) GetLatestMetadata(ctx context.Context, req *grpc.GetLatestMetadataRequest) (*grpc.GetLatestMetadataResponse, error) { options := translateSearchOptions(req.GetOptions()) - indexKey, err := s.indexService.GetLatestIndexKey(ctx, options) + metadata, err := s.indexService.GetLatestMetadataFromRaw(ctx, options) if err != nil { return nil, fmt.Errorf("failed to get latest index key: %w", err) } - return &grpc.GetLatestIndexKeyResponse{IndexKey: indexKey}, nil + return &grpc.GetLatestMetadataResponse{ + Metadata: &grpc.CloudEventMetadata{ + Key: metadata.Key, + Header: cloudEventHeaderToProto(&metadata.CloudEventHeader), + }, + }, nil } -// GetIndexKeys translates the gRPC call to the indexrepo type and fetches index keys for the given options. -func (s *Server) GetIndexKeys(ctx context.Context, req *grpc.GetIndexKeysRequest) (*grpc.GetIndexKeysResponse, error) { +// ListMetadata translates the gRPC call to the indexrepo type and fetches index keys for the given options. +func (s *Server) ListMetadata(ctx context.Context, req *grpc.ListMetadataRequest) (*grpc.ListMetadataResponse, error) { options := translateSearchOptions(req.GetOptions()) - indexKeys, err := s.indexService.GetIndexKeys(ctx, int(req.GetLimit()), options) + metaDataObjs, err := s.indexService.ListMetadataFromRaw(ctx, int(req.GetLimit()), options) if err != nil { return nil, fmt.Errorf("failed to get index keys: %w", err) } - return &grpc.GetIndexKeysResponse{IndexKeys: indexKeys}, nil + metadataList := make([]*grpc.CloudEventMetadata, len(metaDataObjs)) + for i := range metaDataObjs { + metadataList[i] = &grpc.CloudEventMetadata{ + Key: metaDataObjs[i].Key, + Header: cloudEventHeaderToProto(&metaDataObjs[i].CloudEventHeader), + } + } + return &grpc.ListMetadataResponse{MetadataList: metadataList}, nil } -// GetObjects translates the gRPC call to the indexrepo type and fetches data for the given options. -func (s *Server) GetObjects(ctx context.Context, req *grpc.GetObjectsRequest) (*grpc.GetObjectsResponse, error) { +// ListCloudEvents translates the gRPC call to the indexrepo type and fetches data for the given options. +func (s *Server) ListCloudEvents(ctx context.Context, req *grpc.ListCloudEventsRequest) (*grpc.ListCloudEventsResponse, error) { options := translateSearchOptions(req.GetOptions()) - idxKeys, err := s.indexService.GetIndexKeys(ctx, int(req.GetLimit()), options) + metaList, err := s.indexService.ListMetadataFromRaw(ctx, int(req.GetLimit()), options) if err != nil { return nil, fmt.Errorf("failed to get objects: %w", err) } - data, err := fetch.GetObjectsFromIndexs(ctx, s.indexService, idxKeys, []string{s.cloudEventBucket, s.ephemeralBucket}) + data, err := fetch.ListCloudEventsFromMetadata(ctx, s.indexService, metaList, []string{s.cloudEventBucket, s.ephemeralBucket}) if err != nil { return nil, fmt.Errorf("failed to get latest object: %w", err) } @@ -69,26 +81,26 @@ func (s *Server) GetObjects(ctx context.Context, req *grpc.GetObjectsRequest) (* for i, d := range data { events[i] = cloudEventToProto(d) } - return &grpc.GetObjectsResponse{CloudEvents: events}, nil + return &grpc.ListCloudEventsResponse{CloudEvents: events}, nil } -// GetLatestObject translates the gRPC call to the indexrepo type and fetches the latest data for the given options. -func (s *Server) GetLatestObject(ctx context.Context, req *grpc.GetLatestObjectRequest) (*grpc.GetLatestObjectResponse, error) { +// GetLatestCloudEvent translates the gRPC call to the indexrepo type and fetches the latest data for the given options. +func (s *Server) GetLatestCloudEvent(ctx context.Context, req *grpc.GetLatestCloudEventRequest) (*grpc.GetLatestCloudEventResponse, error) { options := translateSearchOptions(req.GetOptions()) - idxKey, err := s.indexService.GetLatestIndexKey(ctx, options) + metdata, err := s.indexService.GetLatestMetadataFromRaw(ctx, options) if err != nil { return nil, fmt.Errorf("failed to get latest object: %w", err) } - latestData, err := fetch.GetObjectFromIndex(ctx, s.indexService, idxKey, []string{s.cloudEventBucket, s.ephemeralBucket}) + latestData, err := fetch.GetCloudEventFromKey(ctx, s.indexService, metdata.Key, []string{s.cloudEventBucket, s.ephemeralBucket}) if err != nil { return nil, fmt.Errorf("failed to get latest object: %w", err) } - return &grpc.GetLatestObjectResponse{CloudEvent: cloudEventToProto(latestData)}, nil + return &grpc.GetLatestCloudEventResponse{CloudEvent: cloudEventToProto(latestData)}, nil } -// GetObjectsFromIndexKeys translates the gRPC call to the indexrepo type and fetches data for the given options. -func (s *Server) GetObjectsFromIndexKeys(ctx context.Context, req *grpc.GetObjectsFromIndexKeysRequest) (*grpc.GetObjectsFromIndexKeysResponse, error) { - data, err := fetch.GetObjectsFromIndexs(ctx, s.indexService, req.GetIndexKeys(), []string{s.cloudEventBucket, s.ephemeralBucket}) +// ListCloudEventsFromKeys translates the gRPC call to the indexrepo type and fetches data for the given options. +func (s *Server) ListCloudEventsFromKeys(ctx context.Context, req *grpc.ListCloudEventsFromKeysRequest) (*grpc.ListCloudEventsFromKeysResponse, error) { + data, err := fetch.GetCloudEventsFromKeys(ctx, s.indexService, req.GetIndexKeys(), []string{s.cloudEventBucket, s.ephemeralBucket}) if err != nil { return nil, fmt.Errorf("failed to get objects: %w", err) } @@ -96,7 +108,7 @@ func (s *Server) GetObjectsFromIndexKeys(ctx context.Context, req *grpc.GetObjec for i, d := range data { dataObjects[i] = cloudEventToProto(d) } - return &grpc.GetObjectsFromIndexKeysResponse{CloudEvents: dataObjects}, nil + return &grpc.ListCloudEventsFromKeysResponse{CloudEvents: dataObjects}, nil } // translateProtoToSearchOptions translates a SearchOptions proto message to the Go SearchOptions type. @@ -145,6 +157,34 @@ func getStringValue(protoStr *wrapperspb.StringValue) *string { return &val } +func cloudEventHeaderToProto(event *cloudevent.CloudEventHeader) *grpc.CloudEventHeader { + if event == nil { + return nil + } + extras := make(map[string][]byte) + for k, v := range event.Extras { + v, err := json.Marshal(v) + if err != nil { + // Skip the extra if it can't be marshaled + continue + } + extras[k] = v + } + return &grpc.CloudEventHeader{ + Id: event.ID, + Source: event.Source, + Producer: event.Producer, + Subject: event.Subject, + SpecVersion: event.SpecVersion, + Time: timestamppb.New(event.Time), + Type: event.Type, + DataContentType: event.DataContentType, + DataSchema: event.DataSchema, + DataVersion: event.DataVersion, + Extras: extras, + } +} + func cloudEventToProto(event cloudevent.CloudEvent[json.RawMessage]) *grpc.CloudEvent { extras := make(map[string][]byte) for k, v := range event.Extras { @@ -156,19 +196,7 @@ func cloudEventToProto(event cloudevent.CloudEvent[json.RawMessage]) *grpc.Cloud extras[k] = v } return &grpc.CloudEvent{ - Header: &grpc.CloudEventHeader{ - Id: event.ID, - Source: event.Source, - Producer: event.Producer, - Subject: event.Subject, - SpecVersion: event.SpecVersion, - Time: timestamppb.New(event.Time), - Type: event.Type, - DataContentType: event.DataContentType, - DataSchema: event.DataSchema, - DataVersion: event.DataVersion, - Extras: extras, - }, - Data: event.Data, + Header: cloudEventHeaderToProto(&event.CloudEventHeader), + Data: event.Data, } } diff --git a/pkg/grpc/cloudevent.proto b/pkg/grpc/cloudevent.proto index 7379834..13d08ae 100644 --- a/pkg/grpc/cloudevent.proto +++ b/pkg/grpc/cloudevent.proto @@ -10,7 +10,7 @@ import "google/protobuf/timestamp.proto"; message CloudEvent { CloudEventHeader header = 1; bytes data = 2; - } +} // CloudEventHeader represents the header structure of a CloudEvent. message CloudEventHeader { diff --git a/pkg/grpc/fetch-api.pb.go b/pkg/grpc/fetch-api.pb.go index d355d7e..6e01c7c 100644 --- a/pkg/grpc/fetch-api.pb.go +++ b/pkg/grpc/fetch-api.pb.go @@ -144,17 +144,19 @@ func (x *SearchOptions) GetOptional() *wrapperspb.StringValue { return nil } -// GetLatestIndexKeyRequest includes search options to filter the events. -type GetLatestIndexKeyRequest struct { +type CloudEventMetadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Options *SearchOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` + // The cloud event header of the cloud event. + Header *CloudEventHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The index key of the cloud event. + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` } -func (x *GetLatestIndexKeyRequest) Reset() { - *x = GetLatestIndexKeyRequest{} +func (x *CloudEventMetadata) Reset() { + *x = CloudEventMetadata{} if protoimpl.UnsafeEnabled { mi := &file_pkg_grpc_fetch_api_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -162,13 +164,13 @@ func (x *GetLatestIndexKeyRequest) Reset() { } } -func (x *GetLatestIndexKeyRequest) String() string { +func (x *CloudEventMetadata) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLatestIndexKeyRequest) ProtoMessage() {} +func (*CloudEventMetadata) ProtoMessage() {} -func (x *GetLatestIndexKeyRequest) ProtoReflect() protoreflect.Message { +func (x *CloudEventMetadata) ProtoReflect() protoreflect.Message { mi := &file_pkg_grpc_fetch_api_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -180,30 +182,36 @@ func (x *GetLatestIndexKeyRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLatestIndexKeyRequest.ProtoReflect.Descriptor instead. -func (*GetLatestIndexKeyRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use CloudEventMetadata.ProtoReflect.Descriptor instead. +func (*CloudEventMetadata) Descriptor() ([]byte, []int) { return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{1} } -func (x *GetLatestIndexKeyRequest) GetOptions() *SearchOptions { +func (x *CloudEventMetadata) GetHeader() *CloudEventHeader { if x != nil { - return x.Options + return x.Header } return nil } -// GetLatestIndexKeyResponse provides the latest index key retrieved for the specified search criteria. -type GetLatestIndexKeyResponse struct { +func (x *CloudEventMetadata) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +// GetLatestMetadataRequest includes search options to filter the events. +type GetLatestMetadataRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The latest index key retrieved for the specified search criteria. - IndexKey string `protobuf:"bytes,1,opt,name=index_key,json=indexKey,proto3" json:"index_key,omitempty"` + Options *SearchOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` } -func (x *GetLatestIndexKeyResponse) Reset() { - *x = GetLatestIndexKeyResponse{} +func (x *GetLatestMetadataRequest) Reset() { + *x = GetLatestMetadataRequest{} if protoimpl.UnsafeEnabled { mi := &file_pkg_grpc_fetch_api_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -211,13 +219,13 @@ func (x *GetLatestIndexKeyResponse) Reset() { } } -func (x *GetLatestIndexKeyResponse) String() string { +func (x *GetLatestMetadataRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLatestIndexKeyResponse) ProtoMessage() {} +func (*GetLatestMetadataRequest) ProtoMessage() {} -func (x *GetLatestIndexKeyResponse) ProtoReflect() protoreflect.Message { +func (x *GetLatestMetadataRequest) ProtoReflect() protoreflect.Message { mi := &file_pkg_grpc_fetch_api_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -229,32 +237,30 @@ func (x *GetLatestIndexKeyResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLatestIndexKeyResponse.ProtoReflect.Descriptor instead. -func (*GetLatestIndexKeyResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetLatestMetadataRequest.ProtoReflect.Descriptor instead. +func (*GetLatestMetadataRequest) Descriptor() ([]byte, []int) { return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{2} } -func (x *GetLatestIndexKeyResponse) GetIndexKey() string { +func (x *GetLatestMetadataRequest) GetOptions() *SearchOptions { if x != nil { - return x.IndexKey + return x.Options } - return "" + return nil } -// GetIndexKeysRequest includes search options to filter the events. -type GetIndexKeysRequest struct { +// GetLatestMetadataResponse provides the latest metadata retrieved for the specified search criteria. +type GetLatestMetadataResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Search options to filter the events. - Options *SearchOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` - // The maximum number of index_keys to return. - Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + // The latest index key retrieved for the specified search criteria. + Metadata *CloudEventMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` } -func (x *GetIndexKeysRequest) Reset() { - *x = GetIndexKeysRequest{} +func (x *GetLatestMetadataResponse) Reset() { + *x = GetLatestMetadataResponse{} if protoimpl.UnsafeEnabled { mi := &file_pkg_grpc_fetch_api_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -262,13 +268,13 @@ func (x *GetIndexKeysRequest) Reset() { } } -func (x *GetIndexKeysRequest) String() string { +func (x *GetLatestMetadataResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetIndexKeysRequest) ProtoMessage() {} +func (*GetLatestMetadataResponse) ProtoMessage() {} -func (x *GetIndexKeysRequest) ProtoReflect() protoreflect.Message { +func (x *GetLatestMetadataResponse) ProtoReflect() protoreflect.Message { mi := &file_pkg_grpc_fetch_api_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -280,52 +286,103 @@ func (x *GetIndexKeysRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetIndexKeysRequest.ProtoReflect.Descriptor instead. -func (*GetIndexKeysRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetLatestMetadataResponse.ProtoReflect.Descriptor instead. +func (*GetLatestMetadataResponse) Descriptor() ([]byte, []int) { return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{3} } -func (x *GetIndexKeysRequest) GetOptions() *SearchOptions { +func (x *GetLatestMetadataResponse) GetMetadata() *CloudEventMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +// ListMetadataRequest includes search options to filter the events. +type ListMetadataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Search options to filter the events. + Options *SearchOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` + // The maximum number of metadata objects to return. + Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (x *ListMetadataRequest) Reset() { + *x = ListMetadataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListMetadataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListMetadataRequest) ProtoMessage() {} + +func (x *ListMetadataRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListMetadataRequest.ProtoReflect.Descriptor instead. +func (*ListMetadataRequest) Descriptor() ([]byte, []int) { + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{4} +} + +func (x *ListMetadataRequest) GetOptions() *SearchOptions { if x != nil { return x.Options } return nil } -func (x *GetIndexKeysRequest) GetLimit() int32 { +func (x *ListMetadataRequest) GetLimit() int32 { if x != nil { return x.Limit } return 0 } -// GetIndexKeysResponse returns the list of index_keys retrieved for the specified search criteria. -type GetIndexKeysResponse struct { +// ListMetadataResponse returns the list of metadata for cloud events retrieved for the specified search criteria. +type ListMetadataResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The list of index_keys retrieved for the specified search criteria. - IndexKeys []string `protobuf:"bytes,1,rep,name=index_keys,json=indexKeys,proto3" json:"index_keys,omitempty"` + // The list of metadata objects retrieved for the specified search criteria. + MetadataList []*CloudEventMetadata `protobuf:"bytes,1,rep,name=metadata_list,json=metadataList,proto3" json:"metadata_list,omitempty"` } -func (x *GetIndexKeysResponse) Reset() { - *x = GetIndexKeysResponse{} +func (x *ListMetadataResponse) Reset() { + *x = ListMetadataResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[4] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetIndexKeysResponse) String() string { +func (x *ListMetadataResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetIndexKeysResponse) ProtoMessage() {} +func (*ListMetadataResponse) ProtoMessage() {} -func (x *GetIndexKeysResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[4] +func (x *ListMetadataResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -336,20 +393,20 @@ func (x *GetIndexKeysResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetIndexKeysResponse.ProtoReflect.Descriptor instead. -func (*GetIndexKeysResponse) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{4} +// Deprecated: Use ListMetadataResponse.ProtoReflect.Descriptor instead. +func (*ListMetadataResponse) Descriptor() ([]byte, []int) { + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{5} } -func (x *GetIndexKeysResponse) GetIndexKeys() []string { +func (x *ListMetadataResponse) GetMetadataList() []*CloudEventMetadata { if x != nil { - return x.IndexKeys + return x.MetadataList } return nil } -// GetLatestObjectRequest includes search options to filter the events. -type GetLatestObjectRequest struct { +// GetLatestCloudEventRequest includes search options to filter the events. +type GetLatestCloudEventRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -358,23 +415,23 @@ type GetLatestObjectRequest struct { Options *SearchOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` } -func (x *GetLatestObjectRequest) Reset() { - *x = GetLatestObjectRequest{} +func (x *GetLatestCloudEventRequest) Reset() { + *x = GetLatestCloudEventRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[5] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetLatestObjectRequest) String() string { +func (x *GetLatestCloudEventRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLatestObjectRequest) ProtoMessage() {} +func (*GetLatestCloudEventRequest) ProtoMessage() {} -func (x *GetLatestObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[5] +func (x *GetLatestCloudEventRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -385,20 +442,20 @@ func (x *GetLatestObjectRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLatestObjectRequest.ProtoReflect.Descriptor instead. -func (*GetLatestObjectRequest) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{5} +// Deprecated: Use GetLatestCloudEventRequest.ProtoReflect.Descriptor instead. +func (*GetLatestCloudEventRequest) Descriptor() ([]byte, []int) { + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{6} } -func (x *GetLatestObjectRequest) GetOptions() *SearchOptions { +func (x *GetLatestCloudEventRequest) GetOptions() *SearchOptions { if x != nil { return x.Options } return nil } -// GetLatestObjectResponse provides the data retrieved from the latest cloud event. -type GetLatestObjectResponse struct { +// GetLatestCloudEventResponse provides the data retrieved from the latest cloud event. +type GetLatestCloudEventResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -407,23 +464,23 @@ type GetLatestObjectResponse struct { CloudEvent *CloudEvent `protobuf:"bytes,1,opt,name=cloud_event,json=cloudEvent,proto3" json:"cloud_event,omitempty"` } -func (x *GetLatestObjectResponse) Reset() { - *x = GetLatestObjectResponse{} +func (x *GetLatestCloudEventResponse) Reset() { + *x = GetLatestCloudEventResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[6] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetLatestObjectResponse) String() string { +func (x *GetLatestCloudEventResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLatestObjectResponse) ProtoMessage() {} +func (*GetLatestCloudEventResponse) ProtoMessage() {} -func (x *GetLatestObjectResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[6] +func (x *GetLatestCloudEventResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -434,20 +491,20 @@ func (x *GetLatestObjectResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLatestObjectResponse.ProtoReflect.Descriptor instead. -func (*GetLatestObjectResponse) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{6} +// Deprecated: Use GetLatestCloudEventResponse.ProtoReflect.Descriptor instead. +func (*GetLatestCloudEventResponse) Descriptor() ([]byte, []int) { + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{7} } -func (x *GetLatestObjectResponse) GetCloudEvent() *CloudEvent { +func (x *GetLatestCloudEventResponse) GetCloudEvent() *CloudEvent { if x != nil { return x.CloudEvent } return nil } -// GetObjectsRequest includes search options to filter the events. -type GetObjectsRequest struct { +// ListCloudEventsRequest includes search options to filter the events. +type ListCloudEventsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -458,23 +515,23 @@ type GetObjectsRequest struct { Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` } -func (x *GetObjectsRequest) Reset() { - *x = GetObjectsRequest{} +func (x *ListCloudEventsRequest) Reset() { + *x = ListCloudEventsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[7] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetObjectsRequest) String() string { +func (x *ListCloudEventsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetObjectsRequest) ProtoMessage() {} +func (*ListCloudEventsRequest) ProtoMessage() {} -func (x *GetObjectsRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[7] +func (x *ListCloudEventsRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -485,27 +542,27 @@ func (x *GetObjectsRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetObjectsRequest.ProtoReflect.Descriptor instead. -func (*GetObjectsRequest) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{7} +// Deprecated: Use ListCloudEventsRequest.ProtoReflect.Descriptor instead. +func (*ListCloudEventsRequest) Descriptor() ([]byte, []int) { + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{8} } -func (x *GetObjectsRequest) GetOptions() *SearchOptions { +func (x *ListCloudEventsRequest) GetOptions() *SearchOptions { if x != nil { return x.Options } return nil } -func (x *GetObjectsRequest) GetLimit() int32 { +func (x *ListCloudEventsRequest) GetLimit() int32 { if x != nil { return x.Limit } return 0 } -// GetObjectsResponse provides the list of data retrieved from the objects. -type GetObjectsResponse struct { +// ListCloudEventsResponse provides the list of data retrieved from the objects. +type ListCloudEventsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -514,23 +571,23 @@ type GetObjectsResponse struct { CloudEvents []*CloudEvent `protobuf:"bytes,1,rep,name=cloud_events,json=cloudEvents,proto3" json:"cloud_events,omitempty"` } -func (x *GetObjectsResponse) Reset() { - *x = GetObjectsResponse{} +func (x *ListCloudEventsResponse) Reset() { + *x = ListCloudEventsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[8] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetObjectsResponse) String() string { +func (x *ListCloudEventsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetObjectsResponse) ProtoMessage() {} +func (*ListCloudEventsResponse) ProtoMessage() {} -func (x *GetObjectsResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[8] +func (x *ListCloudEventsResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -541,20 +598,20 @@ func (x *GetObjectsResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetObjectsResponse.ProtoReflect.Descriptor instead. -func (*GetObjectsResponse) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{8} +// Deprecated: Use ListCloudEventsResponse.ProtoReflect.Descriptor instead. +func (*ListCloudEventsResponse) Descriptor() ([]byte, []int) { + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{9} } -func (x *GetObjectsResponse) GetCloudEvents() []*CloudEvent { +func (x *ListCloudEventsResponse) GetCloudEvents() []*CloudEvent { if x != nil { return x.CloudEvents } return nil } -// GetObjectsFromIndexKeysRequest includes the index key to filter the events. -type GetObjectsFromIndexKeysRequest struct { +// ListCloudEventsFromKeysRequest includes the index key to filter the events. +type ListCloudEventsFromKeysRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -563,23 +620,23 @@ type GetObjectsFromIndexKeysRequest struct { IndexKeys []string `protobuf:"bytes,1,rep,name=index_keys,json=indexKeys,proto3" json:"index_keys,omitempty"` } -func (x *GetObjectsFromIndexKeysRequest) Reset() { - *x = GetObjectsFromIndexKeysRequest{} +func (x *ListCloudEventsFromKeysRequest) Reset() { + *x = ListCloudEventsFromKeysRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[9] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetObjectsFromIndexKeysRequest) String() string { +func (x *ListCloudEventsFromKeysRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetObjectsFromIndexKeysRequest) ProtoMessage() {} +func (*ListCloudEventsFromKeysRequest) ProtoMessage() {} -func (x *GetObjectsFromIndexKeysRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[9] +func (x *ListCloudEventsFromKeysRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -590,20 +647,20 @@ func (x *GetObjectsFromIndexKeysRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetObjectsFromIndexKeysRequest.ProtoReflect.Descriptor instead. -func (*GetObjectsFromIndexKeysRequest) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{9} +// Deprecated: Use ListCloudEventsFromKeysRequest.ProtoReflect.Descriptor instead. +func (*ListCloudEventsFromKeysRequest) Descriptor() ([]byte, []int) { + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{10} } -func (x *GetObjectsFromIndexKeysRequest) GetIndexKeys() []string { +func (x *ListCloudEventsFromKeysRequest) GetIndexKeys() []string { if x != nil { return x.IndexKeys } return nil } -// GetObjectsFromNameResponse provides the list of data retrieved from the objects. -type GetObjectsFromIndexKeysResponse struct { +// ListCloudEventsFromNameResponse provides the list of data retrieved from the objects. +type ListCloudEventsFromKeysResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -612,23 +669,23 @@ type GetObjectsFromIndexKeysResponse struct { CloudEvents []*CloudEvent `protobuf:"bytes,1,rep,name=cloud_events,json=cloudEvents,proto3" json:"cloud_events,omitempty"` } -func (x *GetObjectsFromIndexKeysResponse) Reset() { - *x = GetObjectsFromIndexKeysResponse{} +func (x *ListCloudEventsFromKeysResponse) Reset() { + *x = ListCloudEventsFromKeysResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[10] + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetObjectsFromIndexKeysResponse) String() string { +func (x *ListCloudEventsFromKeysResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetObjectsFromIndexKeysResponse) ProtoMessage() {} +func (*ListCloudEventsFromKeysResponse) ProtoMessage() {} -func (x *GetObjectsFromIndexKeysResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_grpc_fetch_api_proto_msgTypes[10] +func (x *ListCloudEventsFromKeysResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_grpc_fetch_api_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -639,12 +696,12 @@ func (x *GetObjectsFromIndexKeysResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetObjectsFromIndexKeysResponse.ProtoReflect.Descriptor instead. -func (*GetObjectsFromIndexKeysResponse) Descriptor() ([]byte, []int) { - return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{10} +// Deprecated: Use ListCloudEventsFromKeysResponse.ProtoReflect.Descriptor instead. +func (*ListCloudEventsFromKeysResponse) Descriptor() ([]byte, []int) { + return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{11} } -func (x *GetObjectsFromIndexKeysResponse) GetCloudEvents() []*CloudEvent { +func (x *ListCloudEventsFromKeysResponse) GetCloudEvents() []*CloudEvent { if x != nil { return x.CloudEvents } @@ -694,85 +751,97 @@ var file_pkg_grpc_fetch_api_proto_rawDesc = []byte{ 0x12, 0x38, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0x49, 0x0a, 0x18, 0x47, 0x65, - 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x38, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x22, - 0x5a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x35, 0x0a, 0x14, 0x47, - 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x73, 0x22, 0x47, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x52, 0x0a, 0x17, 0x47, - 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, - 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0x5c, 0x0a, 0x12, 0x43, 0x6c, + 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x34, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, + 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x49, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x4f, 0x0a, 0x12, 0x47, 0x65, 0x74, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x3f, 0x0a, 0x1e, 0x47, 0x65, - 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x5c, 0x0a, 0x1f, 0x47, - 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, - 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x32, 0xa4, 0x03, 0x0a, 0x0c, 0x46, 0x65, - 0x74, 0x63, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, - 0x1e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x45, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, - 0x12, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x61, - 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, - 0x65, 0x79, 0x73, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, - 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x66, 0x65, 0x74, 0x63, - 0x68, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x73, 0x22, 0x51, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x34, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x5a, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x22, 0x55, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0d, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0c, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x4b, 0x0a, 0x1a, 0x47, 0x65, 0x74, + 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x56, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, + 0x65, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x52, 0x0a, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x5d, + 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x54, 0x0a, + 0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x22, 0x3f, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6b, + 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x4b, 0x65, 0x79, 0x73, 0x22, 0x5c, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x4b, 0x65, 0x79, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x32, 0xbf, 0x03, 0x0a, 0x0c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x4c, 0x69, 0x73, + 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x5a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, + 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0f, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x17, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x46, + 0x72, 0x6f, 0x6d, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x46, 0x72, + 0x6f, 0x6d, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x44, 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, + 0x66, 0x65, 0x74, 0x63, 0x68, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -787,56 +856,61 @@ func file_pkg_grpc_fetch_api_proto_rawDescGZIP() []byte { return file_pkg_grpc_fetch_api_proto_rawDescData } -var file_pkg_grpc_fetch_api_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_pkg_grpc_fetch_api_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_pkg_grpc_fetch_api_proto_goTypes = []any{ (*SearchOptions)(nil), // 0: grpc.SearchOptions - (*GetLatestIndexKeyRequest)(nil), // 1: grpc.GetLatestIndexKeyRequest - (*GetLatestIndexKeyResponse)(nil), // 2: grpc.GetLatestIndexKeyResponse - (*GetIndexKeysRequest)(nil), // 3: grpc.GetIndexKeysRequest - (*GetIndexKeysResponse)(nil), // 4: grpc.GetIndexKeysResponse - (*GetLatestObjectRequest)(nil), // 5: grpc.GetLatestObjectRequest - (*GetLatestObjectResponse)(nil), // 6: grpc.GetLatestObjectResponse - (*GetObjectsRequest)(nil), // 7: grpc.GetObjectsRequest - (*GetObjectsResponse)(nil), // 8: grpc.GetObjectsResponse - (*GetObjectsFromIndexKeysRequest)(nil), // 9: grpc.GetObjectsFromIndexKeysRequest - (*GetObjectsFromIndexKeysResponse)(nil), // 10: grpc.GetObjectsFromIndexKeysResponse - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp - (*wrapperspb.BoolValue)(nil), // 12: google.protobuf.BoolValue - (*wrapperspb.StringValue)(nil), // 13: google.protobuf.StringValue - (*CloudEvent)(nil), // 14: cloudevent.CloudEvent + (*CloudEventMetadata)(nil), // 1: grpc.CloudEventMetadata + (*GetLatestMetadataRequest)(nil), // 2: grpc.GetLatestMetadataRequest + (*GetLatestMetadataResponse)(nil), // 3: grpc.GetLatestMetadataResponse + (*ListMetadataRequest)(nil), // 4: grpc.ListMetadataRequest + (*ListMetadataResponse)(nil), // 5: grpc.ListMetadataResponse + (*GetLatestCloudEventRequest)(nil), // 6: grpc.GetLatestCloudEventRequest + (*GetLatestCloudEventResponse)(nil), // 7: grpc.GetLatestCloudEventResponse + (*ListCloudEventsRequest)(nil), // 8: grpc.ListCloudEventsRequest + (*ListCloudEventsResponse)(nil), // 9: grpc.ListCloudEventsResponse + (*ListCloudEventsFromKeysRequest)(nil), // 10: grpc.ListCloudEventsFromKeysRequest + (*ListCloudEventsFromKeysResponse)(nil), // 11: grpc.ListCloudEventsFromKeysResponse + (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp + (*wrapperspb.BoolValue)(nil), // 13: google.protobuf.BoolValue + (*wrapperspb.StringValue)(nil), // 14: google.protobuf.StringValue + (*CloudEventHeader)(nil), // 15: cloudevent.CloudEventHeader + (*CloudEvent)(nil), // 16: cloudevent.CloudEvent } var file_pkg_grpc_fetch_api_proto_depIdxs = []int32{ - 11, // 0: grpc.SearchOptions.after:type_name -> google.protobuf.Timestamp - 11, // 1: grpc.SearchOptions.before:type_name -> google.protobuf.Timestamp - 12, // 2: grpc.SearchOptions.timestamp_asc:type_name -> google.protobuf.BoolValue - 13, // 3: grpc.SearchOptions.type:type_name -> google.protobuf.StringValue - 13, // 4: grpc.SearchOptions.data_version:type_name -> google.protobuf.StringValue - 13, // 5: grpc.SearchOptions.subject:type_name -> google.protobuf.StringValue - 13, // 6: grpc.SearchOptions.source:type_name -> google.protobuf.StringValue - 13, // 7: grpc.SearchOptions.producer:type_name -> google.protobuf.StringValue - 13, // 8: grpc.SearchOptions.optional:type_name -> google.protobuf.StringValue - 0, // 9: grpc.GetLatestIndexKeyRequest.options:type_name -> grpc.SearchOptions - 0, // 10: grpc.GetIndexKeysRequest.options:type_name -> grpc.SearchOptions - 0, // 11: grpc.GetLatestObjectRequest.options:type_name -> grpc.SearchOptions - 14, // 12: grpc.GetLatestObjectResponse.cloud_event:type_name -> cloudevent.CloudEvent - 0, // 13: grpc.GetObjectsRequest.options:type_name -> grpc.SearchOptions - 14, // 14: grpc.GetObjectsResponse.cloud_events:type_name -> cloudevent.CloudEvent - 14, // 15: grpc.GetObjectsFromIndexKeysResponse.cloud_events:type_name -> cloudevent.CloudEvent - 1, // 16: grpc.FetchService.GetLatestIndexKey:input_type -> grpc.GetLatestIndexKeyRequest - 3, // 17: grpc.FetchService.GetIndexKeys:input_type -> grpc.GetIndexKeysRequest - 5, // 18: grpc.FetchService.GetLatestObject:input_type -> grpc.GetLatestObjectRequest - 7, // 19: grpc.FetchService.GetObjects:input_type -> grpc.GetObjectsRequest - 9, // 20: grpc.FetchService.GetObjectsFromIndexKeys:input_type -> grpc.GetObjectsFromIndexKeysRequest - 2, // 21: grpc.FetchService.GetLatestIndexKey:output_type -> grpc.GetLatestIndexKeyResponse - 4, // 22: grpc.FetchService.GetIndexKeys:output_type -> grpc.GetIndexKeysResponse - 6, // 23: grpc.FetchService.GetLatestObject:output_type -> grpc.GetLatestObjectResponse - 8, // 24: grpc.FetchService.GetObjects:output_type -> grpc.GetObjectsResponse - 10, // 25: grpc.FetchService.GetObjectsFromIndexKeys:output_type -> grpc.GetObjectsFromIndexKeysResponse - 21, // [21:26] is the sub-list for method output_type - 16, // [16:21] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 12, // 0: grpc.SearchOptions.after:type_name -> google.protobuf.Timestamp + 12, // 1: grpc.SearchOptions.before:type_name -> google.protobuf.Timestamp + 13, // 2: grpc.SearchOptions.timestamp_asc:type_name -> google.protobuf.BoolValue + 14, // 3: grpc.SearchOptions.type:type_name -> google.protobuf.StringValue + 14, // 4: grpc.SearchOptions.data_version:type_name -> google.protobuf.StringValue + 14, // 5: grpc.SearchOptions.subject:type_name -> google.protobuf.StringValue + 14, // 6: grpc.SearchOptions.source:type_name -> google.protobuf.StringValue + 14, // 7: grpc.SearchOptions.producer:type_name -> google.protobuf.StringValue + 14, // 8: grpc.SearchOptions.optional:type_name -> google.protobuf.StringValue + 15, // 9: grpc.CloudEventMetadata.header:type_name -> cloudevent.CloudEventHeader + 0, // 10: grpc.GetLatestMetadataRequest.options:type_name -> grpc.SearchOptions + 1, // 11: grpc.GetLatestMetadataResponse.metadata:type_name -> grpc.CloudEventMetadata + 0, // 12: grpc.ListMetadataRequest.options:type_name -> grpc.SearchOptions + 1, // 13: grpc.ListMetadataResponse.metadata_list:type_name -> grpc.CloudEventMetadata + 0, // 14: grpc.GetLatestCloudEventRequest.options:type_name -> grpc.SearchOptions + 16, // 15: grpc.GetLatestCloudEventResponse.cloud_event:type_name -> cloudevent.CloudEvent + 0, // 16: grpc.ListCloudEventsRequest.options:type_name -> grpc.SearchOptions + 16, // 17: grpc.ListCloudEventsResponse.cloud_events:type_name -> cloudevent.CloudEvent + 16, // 18: grpc.ListCloudEventsFromKeysResponse.cloud_events:type_name -> cloudevent.CloudEvent + 2, // 19: grpc.FetchService.GetLatestMetadata:input_type -> grpc.GetLatestMetadataRequest + 4, // 20: grpc.FetchService.ListMetadata:input_type -> grpc.ListMetadataRequest + 6, // 21: grpc.FetchService.GetLatestCloudEvent:input_type -> grpc.GetLatestCloudEventRequest + 8, // 22: grpc.FetchService.ListCloudEvents:input_type -> grpc.ListCloudEventsRequest + 10, // 23: grpc.FetchService.ListCloudEventsFromKeys:input_type -> grpc.ListCloudEventsFromKeysRequest + 3, // 24: grpc.FetchService.GetLatestMetadata:output_type -> grpc.GetLatestMetadataResponse + 5, // 25: grpc.FetchService.ListMetadata:output_type -> grpc.ListMetadataResponse + 7, // 26: grpc.FetchService.GetLatestCloudEvent:output_type -> grpc.GetLatestCloudEventResponse + 9, // 27: grpc.FetchService.ListCloudEvents:output_type -> grpc.ListCloudEventsResponse + 11, // 28: grpc.FetchService.ListCloudEventsFromKeys:output_type -> grpc.ListCloudEventsFromKeysResponse + 24, // [24:29] is the sub-list for method output_type + 19, // [19:24] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name } func init() { file_pkg_grpc_fetch_api_proto_init() } @@ -859,7 +933,7 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*GetLatestIndexKeyRequest); i { + switch v := v.(*CloudEventMetadata); i { case 0: return &v.state case 1: @@ -871,7 +945,7 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GetLatestIndexKeyResponse); i { + switch v := v.(*GetLatestMetadataRequest); i { case 0: return &v.state case 1: @@ -883,7 +957,7 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*GetIndexKeysRequest); i { + switch v := v.(*GetLatestMetadataResponse); i { case 0: return &v.state case 1: @@ -895,7 +969,7 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*GetIndexKeysResponse); i { + switch v := v.(*ListMetadataRequest); i { case 0: return &v.state case 1: @@ -907,7 +981,7 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*GetLatestObjectRequest); i { + switch v := v.(*ListMetadataResponse); i { case 0: return &v.state case 1: @@ -919,7 +993,7 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*GetLatestObjectResponse); i { + switch v := v.(*GetLatestCloudEventRequest); i { case 0: return &v.state case 1: @@ -931,7 +1005,7 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*GetObjectsRequest); i { + switch v := v.(*GetLatestCloudEventResponse); i { case 0: return &v.state case 1: @@ -943,7 +1017,7 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*GetObjectsResponse); i { + switch v := v.(*ListCloudEventsRequest); i { case 0: return &v.state case 1: @@ -955,7 +1029,7 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*GetObjectsFromIndexKeysRequest); i { + switch v := v.(*ListCloudEventsResponse); i { case 0: return &v.state case 1: @@ -967,7 +1041,19 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*GetObjectsFromIndexKeysResponse); i { + switch v := v.(*ListCloudEventsFromKeysRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_grpc_fetch_api_proto_msgTypes[11].Exporter = func(v any, i int) any { + switch v := v.(*ListCloudEventsFromKeysResponse); i { case 0: return &v.state case 1: @@ -985,7 +1071,7 @@ func file_pkg_grpc_fetch_api_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pkg_grpc_fetch_api_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/grpc/fetch-api.proto b/pkg/grpc/fetch-api.proto index b3f6f1e..a3448e8 100644 --- a/pkg/grpc/fetch-api.proto +++ b/pkg/grpc/fetch-api.proto @@ -10,20 +10,20 @@ import "pkg/grpc/cloudevent.proto"; // FetchService defines the gRPC service for fetching DIMO objects service FetchService { - // GetLatestIndexKey returns the latest index key for the given options - rpc GetLatestIndexKey (GetLatestIndexKeyRequest) returns (GetLatestIndexKeyResponse); + // GetLatestMetadatareturns the latest index key for the given options + rpc GetLatestMetadata (GetLatestMetadataRequest) returns (GetLatestMetadataResponse); - // GetIndexKeys fetches and returns the list of index_keys that match the specified options - rpc GetIndexKeys (GetIndexKeysRequest) returns (GetIndexKeysResponse); + // ListMetadata fetches and returns the list of cloud event metadata objects that match the specified options + rpc ListMetadata (ListMetadataRequest) returns (ListMetadataResponse); - // GetLatestObject fetches and returns the latest object that matches the specified options - rpc GetLatestObject (GetLatestObjectRequest) returns (GetLatestObjectResponse); + // GetLatestCloudEvent fetches and returns the latest object that matches the specified options + rpc GetLatestCloudEvent (GetLatestCloudEventRequest) returns (GetLatestCloudEventResponse); - // GetObjects fetches and returns the list of objects that match the specified options - rpc GetObjects (GetObjectsRequest) returns (GetObjectsResponse); + // ListCloudEvents fetches and returns the list of objects that match the specified options + rpc ListCloudEvents (ListCloudEventsRequest) returns (ListCloudEventsResponse); - // GetObjectsFromIndexKeys fetches and returns the list of objects that match the specified index key - rpc GetObjectsFromIndexKeys (GetObjectsFromIndexKeysRequest) returns (GetObjectsFromIndexKeysResponse); + // ListCloudEventsFromKeys fetches and returns the list of objects that match the specified index key + rpc ListCloudEventsFromKeys (ListCloudEventsFromKeysRequest) returns (ListCloudEventsFromKeysResponse); } // SearchOptions provides filtering options to narrow down the search results for objects @@ -57,47 +57,54 @@ message SearchOptions { google.protobuf.StringValue optional = 10; } +message CloudEventMetadata { + // The cloud event header of the cloud event. + cloudevent.CloudEventHeader header = 1; + // The index key of the cloud event. + string key = 2; +} + -// GetLatestIndexKeyRequest includes search options to filter the events. -message GetLatestIndexKeyRequest { +// GetLatestMetadataRequest includes search options to filter the events. +message GetLatestMetadataRequest { SearchOptions options = 1; } -// GetLatestIndexKeyResponse provides the latest index key retrieved for the specified search criteria. -message GetLatestIndexKeyResponse { +// GetLatestMetadataResponse provides the latest metadata retrieved for the specified search criteria. +message GetLatestMetadataResponse { // The latest index key retrieved for the specified search criteria. - string index_key = 1; + CloudEventMetadata metadata = 1; } -// GetIndexKeysRequest includes search options to filter the events. -message GetIndexKeysRequest{ +// ListMetadataRequest includes search options to filter the events. +message ListMetadataRequest{ // Search options to filter the events. SearchOptions options = 1; - // The maximum number of index_keys to return. + // The maximum number of metadata objects to return. int32 limit = 2; } -// GetIndexKeysResponse returns the list of index_keys retrieved for the specified search criteria. -message GetIndexKeysResponse{ - // The list of index_keys retrieved for the specified search criteria. - repeated string index_keys = 1; +// ListMetadataResponse returns the list of metadata for cloud events retrieved for the specified search criteria. +message ListMetadataResponse{ + // The list of metadata objects retrieved for the specified search criteria. + repeated CloudEventMetadata metadata_list = 1; } -// GetLatestObjectRequest includes search options to filter the events. -message GetLatestObjectRequest { +// GetLatestCloudEventRequest includes search options to filter the events. +message GetLatestCloudEventRequest { // Search options to filter the events. SearchOptions options = 1; } -// GetLatestObjectResponse provides the data retrieved from the latest cloud event. -message GetLatestObjectResponse { +// GetLatestCloudEventResponse provides the data retrieved from the latest cloud event. +message GetLatestCloudEventResponse { // The data retrieved from the latest cloud event. cloudevent.CloudEvent cloud_event = 1; } -// GetObjectsRequest includes search options to filter the events. -message GetObjectsRequest { +// ListCloudEventsRequest includes search options to filter the events. +message ListCloudEventsRequest { // Search options to filter the events. SearchOptions options = 1; @@ -105,20 +112,20 @@ message GetObjectsRequest { int32 limit = 2; } -// GetObjectsResponse provides the list of data retrieved from the objects. -message GetObjectsResponse { +// ListCloudEventsResponse provides the list of data retrieved from the objects. +message ListCloudEventsResponse { // The list of data retrieved from the objects. repeated cloudevent.CloudEvent cloud_events = 1; } -// GetObjectsFromIndexKeysRequest includes the index key to filter the events. -message GetObjectsFromIndexKeysRequest { +// ListCloudEventsFromKeysRequest includes the index key to filter the events. +message ListCloudEventsFromKeysRequest { // The index_keys that will be retrieved. repeated string index_keys = 1; } -// GetObjectsFromNameResponse provides the list of data retrieved from the objects. -message GetObjectsFromIndexKeysResponse { +// ListCloudEventsFromNameResponse provides the list of data retrieved from the objects. +message ListCloudEventsFromKeysResponse { // The list of data retrieved from the objects. repeated cloudevent.CloudEvent cloud_events = 1; } \ No newline at end of file diff --git a/pkg/grpc/fetch-api_grpc.pb.go b/pkg/grpc/fetch-api_grpc.pb.go index bd6557f..600d48f 100644 --- a/pkg/grpc/fetch-api_grpc.pb.go +++ b/pkg/grpc/fetch-api_grpc.pb.go @@ -19,11 +19,11 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - FetchService_GetLatestIndexKey_FullMethodName = "/grpc.FetchService/GetLatestIndexKey" - FetchService_GetIndexKeys_FullMethodName = "/grpc.FetchService/GetIndexKeys" - FetchService_GetLatestObject_FullMethodName = "/grpc.FetchService/GetLatestObject" - FetchService_GetObjects_FullMethodName = "/grpc.FetchService/GetObjects" - FetchService_GetObjectsFromIndexKeys_FullMethodName = "/grpc.FetchService/GetObjectsFromIndexKeys" + FetchService_GetLatestMetadata_FullMethodName = "/grpc.FetchService/GetLatestMetadata" + FetchService_ListMetadata_FullMethodName = "/grpc.FetchService/ListMetadata" + FetchService_GetLatestCloudEvent_FullMethodName = "/grpc.FetchService/GetLatestCloudEvent" + FetchService_ListCloudEvents_FullMethodName = "/grpc.FetchService/ListCloudEvents" + FetchService_ListCloudEventsFromKeys_FullMethodName = "/grpc.FetchService/ListCloudEventsFromKeys" ) // FetchServiceClient is the client API for FetchService service. @@ -32,16 +32,16 @@ const ( // // FetchService defines the gRPC service for fetching DIMO objects type FetchServiceClient interface { - // GetLatestIndexKey returns the latest index key for the given options - GetLatestIndexKey(ctx context.Context, in *GetLatestIndexKeyRequest, opts ...grpc.CallOption) (*GetLatestIndexKeyResponse, error) - // GetIndexKeys fetches and returns the list of index_keys that match the specified options - GetIndexKeys(ctx context.Context, in *GetIndexKeysRequest, opts ...grpc.CallOption) (*GetIndexKeysResponse, error) - // GetLatestObject fetches and returns the latest object that matches the specified options - GetLatestObject(ctx context.Context, in *GetLatestObjectRequest, opts ...grpc.CallOption) (*GetLatestObjectResponse, error) - // GetObjects fetches and returns the list of objects that match the specified options - GetObjects(ctx context.Context, in *GetObjectsRequest, opts ...grpc.CallOption) (*GetObjectsResponse, error) - // GetObjectsFromIndexKeys fetches and returns the list of objects that match the specified index key - GetObjectsFromIndexKeys(ctx context.Context, in *GetObjectsFromIndexKeysRequest, opts ...grpc.CallOption) (*GetObjectsFromIndexKeysResponse, error) + // GetLatestMetadatareturns the latest index key for the given options + GetLatestMetadata(ctx context.Context, in *GetLatestMetadataRequest, opts ...grpc.CallOption) (*GetLatestMetadataResponse, error) + // ListMetadata fetches and returns the list of cloud event metadata objects that match the specified options + ListMetadata(ctx context.Context, in *ListMetadataRequest, opts ...grpc.CallOption) (*ListMetadataResponse, error) + // GetLatestCloudEvent fetches and returns the latest object that matches the specified options + GetLatestCloudEvent(ctx context.Context, in *GetLatestCloudEventRequest, opts ...grpc.CallOption) (*GetLatestCloudEventResponse, error) + // ListCloudEvents fetches and returns the list of objects that match the specified options + ListCloudEvents(ctx context.Context, in *ListCloudEventsRequest, opts ...grpc.CallOption) (*ListCloudEventsResponse, error) + // ListCloudEventsFromKeys fetches and returns the list of objects that match the specified index key + ListCloudEventsFromKeys(ctx context.Context, in *ListCloudEventsFromKeysRequest, opts ...grpc.CallOption) (*ListCloudEventsFromKeysResponse, error) } type fetchServiceClient struct { @@ -52,50 +52,50 @@ func NewFetchServiceClient(cc grpc.ClientConnInterface) FetchServiceClient { return &fetchServiceClient{cc} } -func (c *fetchServiceClient) GetLatestIndexKey(ctx context.Context, in *GetLatestIndexKeyRequest, opts ...grpc.CallOption) (*GetLatestIndexKeyResponse, error) { +func (c *fetchServiceClient) GetLatestMetadata(ctx context.Context, in *GetLatestMetadataRequest, opts ...grpc.CallOption) (*GetLatestMetadataResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetLatestIndexKeyResponse) - err := c.cc.Invoke(ctx, FetchService_GetLatestIndexKey_FullMethodName, in, out, cOpts...) + out := new(GetLatestMetadataResponse) + err := c.cc.Invoke(ctx, FetchService_GetLatestMetadata_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *fetchServiceClient) GetIndexKeys(ctx context.Context, in *GetIndexKeysRequest, opts ...grpc.CallOption) (*GetIndexKeysResponse, error) { +func (c *fetchServiceClient) ListMetadata(ctx context.Context, in *ListMetadataRequest, opts ...grpc.CallOption) (*ListMetadataResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetIndexKeysResponse) - err := c.cc.Invoke(ctx, FetchService_GetIndexKeys_FullMethodName, in, out, cOpts...) + out := new(ListMetadataResponse) + err := c.cc.Invoke(ctx, FetchService_ListMetadata_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *fetchServiceClient) GetLatestObject(ctx context.Context, in *GetLatestObjectRequest, opts ...grpc.CallOption) (*GetLatestObjectResponse, error) { +func (c *fetchServiceClient) GetLatestCloudEvent(ctx context.Context, in *GetLatestCloudEventRequest, opts ...grpc.CallOption) (*GetLatestCloudEventResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetLatestObjectResponse) - err := c.cc.Invoke(ctx, FetchService_GetLatestObject_FullMethodName, in, out, cOpts...) + out := new(GetLatestCloudEventResponse) + err := c.cc.Invoke(ctx, FetchService_GetLatestCloudEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *fetchServiceClient) GetObjects(ctx context.Context, in *GetObjectsRequest, opts ...grpc.CallOption) (*GetObjectsResponse, error) { +func (c *fetchServiceClient) ListCloudEvents(ctx context.Context, in *ListCloudEventsRequest, opts ...grpc.CallOption) (*ListCloudEventsResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetObjectsResponse) - err := c.cc.Invoke(ctx, FetchService_GetObjects_FullMethodName, in, out, cOpts...) + out := new(ListCloudEventsResponse) + err := c.cc.Invoke(ctx, FetchService_ListCloudEvents_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *fetchServiceClient) GetObjectsFromIndexKeys(ctx context.Context, in *GetObjectsFromIndexKeysRequest, opts ...grpc.CallOption) (*GetObjectsFromIndexKeysResponse, error) { +func (c *fetchServiceClient) ListCloudEventsFromKeys(ctx context.Context, in *ListCloudEventsFromKeysRequest, opts ...grpc.CallOption) (*ListCloudEventsFromKeysResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetObjectsFromIndexKeysResponse) - err := c.cc.Invoke(ctx, FetchService_GetObjectsFromIndexKeys_FullMethodName, in, out, cOpts...) + out := new(ListCloudEventsFromKeysResponse) + err := c.cc.Invoke(ctx, FetchService_ListCloudEventsFromKeys_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -108,16 +108,16 @@ func (c *fetchServiceClient) GetObjectsFromIndexKeys(ctx context.Context, in *Ge // // FetchService defines the gRPC service for fetching DIMO objects type FetchServiceServer interface { - // GetLatestIndexKey returns the latest index key for the given options - GetLatestIndexKey(context.Context, *GetLatestIndexKeyRequest) (*GetLatestIndexKeyResponse, error) - // GetIndexKeys fetches and returns the list of index_keys that match the specified options - GetIndexKeys(context.Context, *GetIndexKeysRequest) (*GetIndexKeysResponse, error) - // GetLatestObject fetches and returns the latest object that matches the specified options - GetLatestObject(context.Context, *GetLatestObjectRequest) (*GetLatestObjectResponse, error) - // GetObjects fetches and returns the list of objects that match the specified options - GetObjects(context.Context, *GetObjectsRequest) (*GetObjectsResponse, error) - // GetObjectsFromIndexKeys fetches and returns the list of objects that match the specified index key - GetObjectsFromIndexKeys(context.Context, *GetObjectsFromIndexKeysRequest) (*GetObjectsFromIndexKeysResponse, error) + // GetLatestMetadatareturns the latest index key for the given options + GetLatestMetadata(context.Context, *GetLatestMetadataRequest) (*GetLatestMetadataResponse, error) + // ListMetadata fetches and returns the list of cloud event metadata objects that match the specified options + ListMetadata(context.Context, *ListMetadataRequest) (*ListMetadataResponse, error) + // GetLatestCloudEvent fetches and returns the latest object that matches the specified options + GetLatestCloudEvent(context.Context, *GetLatestCloudEventRequest) (*GetLatestCloudEventResponse, error) + // ListCloudEvents fetches and returns the list of objects that match the specified options + ListCloudEvents(context.Context, *ListCloudEventsRequest) (*ListCloudEventsResponse, error) + // ListCloudEventsFromKeys fetches and returns the list of objects that match the specified index key + ListCloudEventsFromKeys(context.Context, *ListCloudEventsFromKeysRequest) (*ListCloudEventsFromKeysResponse, error) mustEmbedUnimplementedFetchServiceServer() } @@ -128,20 +128,20 @@ type FetchServiceServer interface { // pointer dereference when methods are called. type UnimplementedFetchServiceServer struct{} -func (UnimplementedFetchServiceServer) GetLatestIndexKey(context.Context, *GetLatestIndexKeyRequest) (*GetLatestIndexKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLatestIndexKey not implemented") +func (UnimplementedFetchServiceServer) GetLatestMetadata(context.Context, *GetLatestMetadataRequest) (*GetLatestMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLatestMetadata not implemented") } -func (UnimplementedFetchServiceServer) GetIndexKeys(context.Context, *GetIndexKeysRequest) (*GetIndexKeysResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetIndexKeys not implemented") +func (UnimplementedFetchServiceServer) ListMetadata(context.Context, *ListMetadataRequest) (*ListMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListMetadata not implemented") } -func (UnimplementedFetchServiceServer) GetLatestObject(context.Context, *GetLatestObjectRequest) (*GetLatestObjectResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLatestObject not implemented") +func (UnimplementedFetchServiceServer) GetLatestCloudEvent(context.Context, *GetLatestCloudEventRequest) (*GetLatestCloudEventResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLatestCloudEvent not implemented") } -func (UnimplementedFetchServiceServer) GetObjects(context.Context, *GetObjectsRequest) (*GetObjectsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetObjects not implemented") +func (UnimplementedFetchServiceServer) ListCloudEvents(context.Context, *ListCloudEventsRequest) (*ListCloudEventsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCloudEvents not implemented") } -func (UnimplementedFetchServiceServer) GetObjectsFromIndexKeys(context.Context, *GetObjectsFromIndexKeysRequest) (*GetObjectsFromIndexKeysResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetObjectsFromIndexKeys not implemented") +func (UnimplementedFetchServiceServer) ListCloudEventsFromKeys(context.Context, *ListCloudEventsFromKeysRequest) (*ListCloudEventsFromKeysResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCloudEventsFromKeys not implemented") } func (UnimplementedFetchServiceServer) mustEmbedUnimplementedFetchServiceServer() {} func (UnimplementedFetchServiceServer) testEmbeddedByValue() {} @@ -164,92 +164,92 @@ func RegisterFetchServiceServer(s grpc.ServiceRegistrar, srv FetchServiceServer) s.RegisterService(&FetchService_ServiceDesc, srv) } -func _FetchService_GetLatestIndexKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLatestIndexKeyRequest) +func _FetchService_GetLatestMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLatestMetadataRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(FetchServiceServer).GetLatestIndexKey(ctx, in) + return srv.(FetchServiceServer).GetLatestMetadata(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FetchService_GetLatestIndexKey_FullMethodName, + FullMethod: FetchService_GetLatestMetadata_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FetchServiceServer).GetLatestIndexKey(ctx, req.(*GetLatestIndexKeyRequest)) + return srv.(FetchServiceServer).GetLatestMetadata(ctx, req.(*GetLatestMetadataRequest)) } return interceptor(ctx, in, info, handler) } -func _FetchService_GetIndexKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetIndexKeysRequest) +func _FetchService_ListMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListMetadataRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(FetchServiceServer).GetIndexKeys(ctx, in) + return srv.(FetchServiceServer).ListMetadata(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FetchService_GetIndexKeys_FullMethodName, + FullMethod: FetchService_ListMetadata_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FetchServiceServer).GetIndexKeys(ctx, req.(*GetIndexKeysRequest)) + return srv.(FetchServiceServer).ListMetadata(ctx, req.(*ListMetadataRequest)) } return interceptor(ctx, in, info, handler) } -func _FetchService_GetLatestObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLatestObjectRequest) +func _FetchService_GetLatestCloudEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLatestCloudEventRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(FetchServiceServer).GetLatestObject(ctx, in) + return srv.(FetchServiceServer).GetLatestCloudEvent(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FetchService_GetLatestObject_FullMethodName, + FullMethod: FetchService_GetLatestCloudEvent_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FetchServiceServer).GetLatestObject(ctx, req.(*GetLatestObjectRequest)) + return srv.(FetchServiceServer).GetLatestCloudEvent(ctx, req.(*GetLatestCloudEventRequest)) } return interceptor(ctx, in, info, handler) } -func _FetchService_GetObjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetObjectsRequest) +func _FetchService_ListCloudEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCloudEventsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(FetchServiceServer).GetObjects(ctx, in) + return srv.(FetchServiceServer).ListCloudEvents(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FetchService_GetObjects_FullMethodName, + FullMethod: FetchService_ListCloudEvents_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FetchServiceServer).GetObjects(ctx, req.(*GetObjectsRequest)) + return srv.(FetchServiceServer).ListCloudEvents(ctx, req.(*ListCloudEventsRequest)) } return interceptor(ctx, in, info, handler) } -func _FetchService_GetObjectsFromIndexKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetObjectsFromIndexKeysRequest) +func _FetchService_ListCloudEventsFromKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCloudEventsFromKeysRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(FetchServiceServer).GetObjectsFromIndexKeys(ctx, in) + return srv.(FetchServiceServer).ListCloudEventsFromKeys(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FetchService_GetObjectsFromIndexKeys_FullMethodName, + FullMethod: FetchService_ListCloudEventsFromKeys_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FetchServiceServer).GetObjectsFromIndexKeys(ctx, req.(*GetObjectsFromIndexKeysRequest)) + return srv.(FetchServiceServer).ListCloudEventsFromKeys(ctx, req.(*ListCloudEventsFromKeysRequest)) } return interceptor(ctx, in, info, handler) } @@ -262,24 +262,24 @@ var FetchService_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*FetchServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "GetLatestIndexKey", - Handler: _FetchService_GetLatestIndexKey_Handler, + MethodName: "GetLatestMetadata", + Handler: _FetchService_GetLatestMetadata_Handler, }, { - MethodName: "GetIndexKeys", - Handler: _FetchService_GetIndexKeys_Handler, + MethodName: "ListMetadata", + Handler: _FetchService_ListMetadata_Handler, }, { - MethodName: "GetLatestObject", - Handler: _FetchService_GetLatestObject_Handler, + MethodName: "GetLatestCloudEvent", + Handler: _FetchService_GetLatestCloudEvent_Handler, }, { - MethodName: "GetObjects", - Handler: _FetchService_GetObjects_Handler, + MethodName: "ListCloudEvents", + Handler: _FetchService_ListCloudEvents_Handler, }, { - MethodName: "GetObjectsFromIndexKeys", - Handler: _FetchService_GetObjectsFromIndexKeys_Handler, + MethodName: "ListCloudEventsFromKeys", + Handler: _FetchService_ListCloudEventsFromKeys_Handler, }, }, Streams: []grpc.StreamDesc{}, From 281cf5446be394c7520ad3442df645cb5f654ce1 Mon Sep 17 00:00:00 2001 From: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com> Date: Wed, 27 Nov 2024 20:50:32 -0500 Subject: [PATCH 7/9] Update for nil options --- go.mod | 2 +- go.sum | 2 ++ internal/fetch/httphandler/httphandler.go | 4 ++-- internal/fetch/rpc/rpc.go | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 5aed1b1..308b2e7 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ClickHouse/clickhouse-go/v2 v2.30.0 github.com/DIMO-Network/clickhouse-infra v0.0.3 github.com/DIMO-Network/model-garage v0.4.2 - github.com/DIMO-Network/nameindexer v0.0.12-0.20241127214708-a71ed3d9f0c6 + github.com/DIMO-Network/nameindexer v0.0.12-0.20241128014811-8c18848b8736 github.com/DIMO-Network/shared v0.11.1 github.com/aws/aws-sdk-go-v2 v1.32.2 github.com/aws/aws-sdk-go-v2/credentials v1.17.27 diff --git a/go.sum b/go.sum index d01dfff..43f3411 100644 --- a/go.sum +++ b/go.sum @@ -76,6 +76,8 @@ github.com/DIMO-Network/model-garage v0.4.2 h1:TF+RNC1n1Y58QSdzmKaf5REixdariAP4t github.com/DIMO-Network/model-garage v0.4.2/go.mod h1:SXaBHFFARooOEoaV1wFaOC1K0LMt0bovkILsFXoUQTg= github.com/DIMO-Network/nameindexer v0.0.12-0.20241127214708-a71ed3d9f0c6 h1:DGNKbmJCWEtrwPOn9c7D1RmUJSB2wU0uAPovoNB0NmQ= github.com/DIMO-Network/nameindexer v0.0.12-0.20241127214708-a71ed3d9f0c6/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= +github.com/DIMO-Network/nameindexer v0.0.12-0.20241128014811-8c18848b8736 h1:3yRiU9z/bBTchj50o6rRBA+S2BBK/yUDK1pYgNNmFoo= +github.com/DIMO-Network/nameindexer v0.0.12-0.20241128014811-8c18848b8736/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= github.com/DIMO-Network/shared v0.11.1 h1:LpI2rROKjrBo6KO76sU3dZDvSv4YbQ4XUBEC4P5NosM= github.com/DIMO-Network/shared v0.11.1/go.mod h1:lm7rUB5i7Jx7t3EomtCwep0aC+sB+nlYYTJkTdUeKHM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= diff --git a/internal/fetch/httphandler/httphandler.go b/internal/fetch/httphandler/httphandler.go index 688d477..efbf3b9 100644 --- a/internal/fetch/httphandler/httphandler.go +++ b/internal/fetch/httphandler/httphandler.go @@ -43,9 +43,9 @@ type searchParams struct { Limit int `query:"limit"` } -func (s *searchParams) toSearchOptions(subject cloudevent.NFTDID) indexrepo.RawSearchOptions { +func (s *searchParams) toSearchOptions(subject cloudevent.NFTDID) *indexrepo.RawSearchOptions { encodedSubject := nameindexer.EncodeNFTDID(subject) - return indexrepo.RawSearchOptions{ + return &indexrepo.RawSearchOptions{ Subject: &encodedSubject, Type: s.Type, Source: s.Source, diff --git a/internal/fetch/rpc/rpc.go b/internal/fetch/rpc/rpc.go index dcf18e0..3d0a533 100644 --- a/internal/fetch/rpc/rpc.go +++ b/internal/fetch/rpc/rpc.go @@ -112,9 +112,9 @@ func (s *Server) ListCloudEventsFromKeys(ctx context.Context, req *grpc.ListClou } // translateProtoToSearchOptions translates a SearchOptions proto message to the Go SearchOptions type. -func translateSearchOptions(protoOptions *grpc.SearchOptions) indexrepo.RawSearchOptions { +func translateSearchOptions(protoOptions *grpc.SearchOptions) *indexrepo.RawSearchOptions { if protoOptions == nil { - return indexrepo.RawSearchOptions{} + return nil } // Converting after timestamp from proto to Go time @@ -135,7 +135,7 @@ func translateSearchOptions(protoOptions *grpc.SearchOptions) indexrepo.RawSearc timestampAsc = protoOptions.GetTimestampAsc().GetValue() } - return indexrepo.RawSearchOptions{ + return &indexrepo.RawSearchOptions{ After: after, Before: before, TimestampAsc: timestampAsc, From d956ab6ff4730051664047936a1d77b97565d72e Mon Sep 17 00:00:00 2001 From: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com> Date: Wed, 27 Nov 2024 20:51:53 -0500 Subject: [PATCH 8/9] tidy --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 43f3411..b70aef3 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,6 @@ github.com/DIMO-Network/clickhouse-infra v0.0.3 h1:B6/4IY9IxLcyydET14IjHUT+A5SDE github.com/DIMO-Network/clickhouse-infra v0.0.3/go.mod h1:NtpQ1btkPzebDvpYYygeqiiBmJ/q5oJb/T/JWzUVRlk= github.com/DIMO-Network/model-garage v0.4.2 h1:TF+RNC1n1Y58QSdzmKaf5REixdariAP4tqHihzjSe70= github.com/DIMO-Network/model-garage v0.4.2/go.mod h1:SXaBHFFARooOEoaV1wFaOC1K0LMt0bovkILsFXoUQTg= -github.com/DIMO-Network/nameindexer v0.0.12-0.20241127214708-a71ed3d9f0c6 h1:DGNKbmJCWEtrwPOn9c7D1RmUJSB2wU0uAPovoNB0NmQ= -github.com/DIMO-Network/nameindexer v0.0.12-0.20241127214708-a71ed3d9f0c6/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= github.com/DIMO-Network/nameindexer v0.0.12-0.20241128014811-8c18848b8736 h1:3yRiU9z/bBTchj50o6rRBA+S2BBK/yUDK1pYgNNmFoo= github.com/DIMO-Network/nameindexer v0.0.12-0.20241128014811-8c18848b8736/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= github.com/DIMO-Network/shared v0.11.1 h1:LpI2rROKjrBo6KO76sU3dZDvSv4YbQ4XUBEC4P5NosM= From 992b3950d48c23b0fb955134359adf0a50b4938e Mon Sep 17 00:00:00 2001 From: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:38:23 -0500 Subject: [PATCH 9/9] Update to released version of nameindexer --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 308b2e7..b939b63 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ClickHouse/clickhouse-go/v2 v2.30.0 github.com/DIMO-Network/clickhouse-infra v0.0.3 github.com/DIMO-Network/model-garage v0.4.2 - github.com/DIMO-Network/nameindexer v0.0.12-0.20241128014811-8c18848b8736 + github.com/DIMO-Network/nameindexer v0.0.12 github.com/DIMO-Network/shared v0.11.1 github.com/aws/aws-sdk-go-v2 v1.32.2 github.com/aws/aws-sdk-go-v2/credentials v1.17.27 diff --git a/go.sum b/go.sum index b70aef3..9dadccf 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/DIMO-Network/clickhouse-infra v0.0.3 h1:B6/4IY9IxLcyydET14IjHUT+A5SDE github.com/DIMO-Network/clickhouse-infra v0.0.3/go.mod h1:NtpQ1btkPzebDvpYYygeqiiBmJ/q5oJb/T/JWzUVRlk= github.com/DIMO-Network/model-garage v0.4.2 h1:TF+RNC1n1Y58QSdzmKaf5REixdariAP4tqHihzjSe70= github.com/DIMO-Network/model-garage v0.4.2/go.mod h1:SXaBHFFARooOEoaV1wFaOC1K0LMt0bovkILsFXoUQTg= -github.com/DIMO-Network/nameindexer v0.0.12-0.20241128014811-8c18848b8736 h1:3yRiU9z/bBTchj50o6rRBA+S2BBK/yUDK1pYgNNmFoo= -github.com/DIMO-Network/nameindexer v0.0.12-0.20241128014811-8c18848b8736/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= +github.com/DIMO-Network/nameindexer v0.0.12 h1:Xh+W27pRrepKCY/oZbp9iNpg311K0qInD1McWB1hkjs= +github.com/DIMO-Network/nameindexer v0.0.12/go.mod h1:Hd+vs7PCqSIdAdkcHprdqQjsMED5fuiHP6TNKdqUajs= github.com/DIMO-Network/shared v0.11.1 h1:LpI2rROKjrBo6KO76sU3dZDvSv4YbQ4XUBEC4P5NosM= github.com/DIMO-Network/shared v0.11.1/go.mod h1:lm7rUB5i7Jx7t3EomtCwep0aC+sB+nlYYTJkTdUeKHM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=