diff --git a/docs/docs.go b/docs/docs.go index fc44343..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": { @@ -255,7 +258,7 @@ const docTemplate = `{ "200": { "description": "Returns latest object data", "schema": { - "$ref": "#/definitions/indexrepo.DataObject" + "$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage" } }, "400": { @@ -337,7 +340,7 @@ const docTemplate = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/indexrepo.DataObject" + "$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage" } } }, @@ -364,36 +367,103 @@ 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" - } - } - }, - "internal_fetch_httphandler.indexKeyResponse": { - "type": "object", - "properties": { - "indexKey": { + }, + "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" } } }, - "internal_fetch_httphandler.indexKeysResponse": { + "indexrepo.CloudEventMetadata": { "type": "object", "properties": { - "indexKeys": { - "type": "array", - "items": { - "type": "string" - } + "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" } } } diff --git a/docs/swagger.json b/docs/swagger.json index 49df94e..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": { @@ -246,7 +249,7 @@ "200": { "description": "Returns latest object data", "schema": { - "$ref": "#/definitions/indexrepo.DataObject" + "$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage" } }, "400": { @@ -328,7 +331,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/indexrepo.DataObject" + "$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage" } } }, @@ -355,36 +358,103 @@ } }, "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" - } - } - }, - "internal_fetch_httphandler.indexKeyResponse": { - "type": "object", - "properties": { - "indexKey": { + }, + "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" } } }, - "internal_fetch_httphandler.indexKeysResponse": { + "indexrepo.CloudEventMetadata": { "type": "object", "properties": { - "indexKeys": { - "type": "array", - "items": { - "type": "string" - } + "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" } } } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index d5e96f9..2f9a154 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,24 +1,108 @@ 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 - type: object - internal_fetch_httphandler.indexKeyResponse: - properties: - indexKey: + 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.indexKeysResponse: + indexrepo.CloudEventMetadata: properties: - indexKeys: - items: - type: string - type: array + 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 info: contact: {} @@ -76,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: @@ -128,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: @@ -180,7 +266,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 +319,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..b939b63 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 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..9dadccf 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 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= @@ -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..9ffb85a 100644 --- a/internal/fetch/fetch.go +++ b/internal/fetch/fetch.go @@ -3,18 +3,33 @@ 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)) +// 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) } @@ -23,21 +38,21 @@ 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) (indexrepo.DataObject, error) { - var obj indexrepo.DataObject +// 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) { 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..efbf3b9 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"` @@ -50,20 +43,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, } } @@ -91,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] @@ -110,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 @@ -126,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] @@ -145,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 @@ -161,7 +149,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] @@ -180,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) } @@ -200,7 +188,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] @@ -218,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 867a9a8..3d0a533 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" ) @@ -21,7 +24,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), @@ -30,85 +33,88 @@ 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) } - 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.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{DataObject: &grpc.DataObject{ - IndexKey: latestData.IndexKey, - Data: latestData.Data, - }}, 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) } - 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.ListCloudEventsFromKeysResponse{CloudEvents: dataObjects}, nil } // 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 nil } // Converting after timestamp from proto to Go time @@ -129,17 +135,16 @@ func translateSearchOptions(protoOptions *grpc.SearchOptions) indexrepo.SearchOp timestampAsc = protoOptions.GetTimestampAsc().GetValue() } - return indexrepo.SearchOptions{ - After: after, - Before: before, - TimestampAsc: timestampAsc, - PrimaryFiller: getStringValue(protoOptions.GetPrimaryFiller()), - DataType: getStringValue(protoOptions.GetDataType()), - 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()), } } @@ -151,3 +156,47 @@ func getStringValue(protoStr *wrapperspb.StringValue) *string { val := protoStr.GetValue() 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 { + 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: cloudEventHeaderToProto(&event.CloudEventHeader), + 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..13d08ae --- /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..6e01c7c 100644 --- a/pkg/grpc/fetch-api.pb.go +++ b/pkg/grpc/fetch-api.pb.go @@ -35,14 +35,12 @@ 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. - 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. @@ -104,16 +102,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 } @@ -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 @@ -153,20 +144,19 @@ func (x *SearchOptions) GetOptional() *wrapperspb.StringValue { return nil } -// DataObject contains the index key and data retrieved from the object. -type DataObject struct { +type CloudEventMetadata 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"` + // 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 *DataObject) Reset() { - *x = DataObject{} +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)) @@ -174,13 +164,13 @@ func (x *DataObject) Reset() { } } -func (x *DataObject) String() string { +func (x *CloudEventMetadata) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DataObject) ProtoMessage() {} +func (*CloudEventMetadata) ProtoMessage() {} -func (x *DataObject) 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)) @@ -192,27 +182,27 @@ func (x *DataObject) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DataObject.ProtoReflect.Descriptor instead. -func (*DataObject) 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 *DataObject) GetIndexKey() string { +func (x *CloudEventMetadata) GetHeader() *CloudEventHeader { if x != nil { - return x.IndexKey + return x.Header } - return "" + return nil } -func (x *DataObject) GetData() []byte { +func (x *CloudEventMetadata) GetKey() string { if x != nil { - return x.Data + return x.Key } - return nil + return "" } -// GetLatestIndexKeyRequest includes search options to filter the events. -type GetLatestIndexKeyRequest struct { +// GetLatestMetadataRequest includes search options to filter the events. +type GetLatestMetadataRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -220,8 +210,8 @@ type GetLatestIndexKeyRequest struct { Options *SearchOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` } -func (x *GetLatestIndexKeyRequest) Reset() { - *x = GetLatestIndexKeyRequest{} +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)) @@ -229,13 +219,13 @@ func (x *GetLatestIndexKeyRequest) Reset() { } } -func (x *GetLatestIndexKeyRequest) String() string { +func (x *GetLatestMetadataRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLatestIndexKeyRequest) ProtoMessage() {} +func (*GetLatestMetadataRequest) ProtoMessage() {} -func (x *GetLatestIndexKeyRequest) 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)) @@ -247,30 +237,30 @@ func (x *GetLatestIndexKeyRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLatestIndexKeyRequest.ProtoReflect.Descriptor instead. -func (*GetLatestIndexKeyRequest) 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 *GetLatestIndexKeyRequest) GetOptions() *SearchOptions { +func (x *GetLatestMetadataRequest) GetOptions() *SearchOptions { if x != nil { return x.Options } return nil } -// GetLatestIndexKeyResponse provides the latest index key retrieved for the specified search criteria. -type GetLatestIndexKeyResponse struct { +// GetLatestMetadataResponse provides the latest metadata retrieved for the specified search criteria. +type GetLatestMetadataResponse 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"` + Metadata *CloudEventMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` } -func (x *GetLatestIndexKeyResponse) Reset() { - *x = GetLatestIndexKeyResponse{} +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)) @@ -278,13 +268,13 @@ func (x *GetLatestIndexKeyResponse) Reset() { } } -func (x *GetLatestIndexKeyResponse) String() string { +func (x *GetLatestMetadataResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLatestIndexKeyResponse) ProtoMessage() {} +func (*GetLatestMetadataResponse) ProtoMessage() {} -func (x *GetLatestIndexKeyResponse) 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)) @@ -296,32 +286,32 @@ func (x *GetLatestIndexKeyResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLatestIndexKeyResponse.ProtoReflect.Descriptor instead. -func (*GetLatestIndexKeyResponse) 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 *GetLatestIndexKeyResponse) GetIndexKey() string { +func (x *GetLatestMetadataResponse) GetMetadata() *CloudEventMetadata { if x != nil { - return x.IndexKey + return x.Metadata } - return "" + return nil } -// GetIndexKeysRequest includes search options to filter the events. -type GetIndexKeysRequest struct { +// 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 index_keys to return. + // The maximum number of metadata objects to return. Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` } -func (x *GetIndexKeysRequest) Reset() { - *x = GetIndexKeysRequest{} +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)) @@ -329,13 +319,13 @@ func (x *GetIndexKeysRequest) Reset() { } } -func (x *GetIndexKeysRequest) String() string { +func (x *ListMetadataRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetIndexKeysRequest) ProtoMessage() {} +func (*ListMetadataRequest) ProtoMessage() {} -func (x *GetIndexKeysRequest) ProtoReflect() protoreflect.Message { +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)) @@ -347,37 +337,37 @@ func (x *GetIndexKeysRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetIndexKeysRequest.ProtoReflect.Descriptor instead. -func (*GetIndexKeysRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use ListMetadataRequest.ProtoReflect.Descriptor instead. +func (*ListMetadataRequest) Descriptor() ([]byte, []int) { return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{4} } -func (x *GetIndexKeysRequest) GetOptions() *SearchOptions { +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[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -385,13 +375,13 @@ func (x *GetIndexKeysResponse) Reset() { } } -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 { +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)) @@ -403,20 +393,20 @@ func (x *GetIndexKeysResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetIndexKeysResponse.ProtoReflect.Descriptor instead. -func (*GetIndexKeysResponse) Descriptor() ([]byte, []int) { +// 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 @@ -425,8 +415,8 @@ 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[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -434,13 +424,13 @@ func (x *GetLatestObjectRequest) Reset() { } } -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 { +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)) @@ -452,30 +442,30 @@ func (x *GetLatestObjectRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLatestObjectRequest.ProtoReflect.Descriptor instead. -func (*GetLatestObjectRequest) Descriptor() ([]byte, []int) { +// 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 // The data retrieved from the latest cloud event. - DataObject *DataObject `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() { - *x = GetLatestObjectResponse{} +func (x *GetLatestCloudEventResponse) Reset() { + *x = GetLatestCloudEventResponse{} if protoimpl.UnsafeEnabled { mi := &file_pkg_grpc_fetch_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -483,13 +473,13 @@ func (x *GetLatestObjectResponse) Reset() { } } -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 { +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)) @@ -501,20 +491,20 @@ func (x *GetLatestObjectResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLatestObjectResponse.ProtoReflect.Descriptor instead. -func (*GetLatestObjectResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetLatestCloudEventResponse.ProtoReflect.Descriptor instead. +func (*GetLatestCloudEventResponse) Descriptor() ([]byte, []int) { return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{7} } -func (x *GetLatestObjectResponse) GetDataObject() *DataObject { +func (x *GetLatestCloudEventResponse) GetCloudEvent() *CloudEvent { if x != nil { - return x.DataObject + 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 @@ -525,8 +515,8 @@ 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[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -534,13 +524,13 @@ func (x *GetObjectsRequest) Reset() { } } -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 { +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)) @@ -552,37 +542,37 @@ func (x *GetObjectsRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetObjectsRequest.ProtoReflect.Descriptor instead. -func (*GetObjectsRequest) Descriptor() ([]byte, []int) { +// 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 // 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{} +func (x *ListCloudEventsResponse) Reset() { + *x = ListCloudEventsResponse{} if protoimpl.UnsafeEnabled { mi := &file_pkg_grpc_fetch_api_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -590,13 +580,13 @@ func (x *GetObjectsResponse) Reset() { } } -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 { +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)) @@ -608,20 +598,20 @@ func (x *GetObjectsResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetObjectsResponse.ProtoReflect.Descriptor instead. -func (*GetObjectsResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use ListCloudEventsResponse.ProtoReflect.Descriptor instead. +func (*ListCloudEventsResponse) Descriptor() ([]byte, []int) { return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{9} } -func (x *GetObjectsResponse) GetDataObjects() []*DataObject { +func (x *ListCloudEventsResponse) GetCloudEvents() []*CloudEvent { if x != nil { - return x.DataObjects + 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 @@ -630,8 +620,8 @@ 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[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -639,13 +629,13 @@ func (x *GetObjectsFromIndexKeysRequest) Reset() { } } -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 { +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)) @@ -657,30 +647,30 @@ func (x *GetObjectsFromIndexKeysRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetObjectsFromIndexKeysRequest.ProtoReflect.Descriptor instead. -func (*GetObjectsFromIndexKeysRequest) Descriptor() ([]byte, []int) { +// 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 // 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{} +func (x *ListCloudEventsFromKeysResponse) Reset() { + *x = ListCloudEventsFromKeysResponse{} if protoimpl.UnsafeEnabled { mi := &file_pkg_grpc_fetch_api_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -688,13 +678,13 @@ func (x *GetObjectsFromIndexKeysResponse) Reset() { } } -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 { +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)) @@ -706,14 +696,14 @@ func (x *GetObjectsFromIndexKeysResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetObjectsFromIndexKeysResponse.ProtoReflect.Descriptor instead. -func (*GetObjectsFromIndexKeysResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use ListCloudEventsFromKeysResponse.ProtoReflect.Descriptor instead. +func (*ListCloudEventsFromKeysResponse) Descriptor() ([]byte, []int) { return file_pkg_grpc_fetch_api_proto_rawDescGZIP(), []int{11} } -func (x *GetObjectsFromIndexKeysResponse) GetDataObjects() []*DataObject { +func (x *ListCloudEventsFromKeysResponse) GetCloudEvents() []*CloudEvent { if x != nil { - return x.DataObjects + return x.CloudEvents } return nil } @@ -727,126 +717,131 @@ 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, 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, + 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, + 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, 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, 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, + 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, 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, + 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, 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, 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, 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, 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, - 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, + 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 ( @@ -864,54 +859,58 @@ func file_pkg_grpc_fetch_api_proto_rawDescGZIP() []byte { 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 - (*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 + (*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{ 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, // 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.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 - 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 - 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 - 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 + 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() } @@ -919,6 +918,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,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.(*DataObject); i { + switch v := v.(*CloudEventMetadata); i { case 0: return &v.state case 1: @@ -945,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.(*GetLatestIndexKeyRequest); i { + switch v := v.(*GetLatestMetadataRequest); i { case 0: return &v.state case 1: @@ -957,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.(*GetLatestIndexKeyResponse); i { + switch v := v.(*GetLatestMetadataResponse); i { case 0: return &v.state case 1: @@ -969,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.(*GetIndexKeysRequest); i { + switch v := v.(*ListMetadataRequest); i { case 0: return &v.state case 1: @@ -981,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.(*GetIndexKeysResponse); i { + switch v := v.(*ListMetadataResponse); i { case 0: return &v.state case 1: @@ -993,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.(*GetLatestObjectRequest); i { + switch v := v.(*GetLatestCloudEventRequest); i { case 0: return &v.state case 1: @@ -1005,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.(*GetLatestObjectResponse); i { + switch v := v.(*GetLatestCloudEventResponse); i { case 0: return &v.state case 1: @@ -1017,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.(*GetObjectsRequest); i { + switch v := v.(*ListCloudEventsRequest); i { case 0: return &v.state case 1: @@ -1029,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.(*GetObjectsResponse); i { + switch v := v.(*ListCloudEventsResponse); i { case 0: return &v.state case 1: @@ -1041,7 +1041,7 @@ 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.(*GetObjectsFromIndexKeysRequest); i { + switch v := v.(*ListCloudEventsFromKeysRequest); i { case 0: return &v.state case 1: @@ -1053,7 +1053,7 @@ func file_pkg_grpc_fetch_api_proto_init() { } } file_pkg_grpc_fetch_api_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*GetObjectsFromIndexKeysResponse); i { + switch v := v.(*ListCloudEventsFromKeysResponse); i { case 0: return &v.state case 1: diff --git a/pkg/grpc/fetch-api.proto b/pkg/grpc/fetch-api.proto index 0feaca1..a3448e8 100644 --- a/pkg/grpc/fetch-api.proto +++ b/pkg/grpc/fetch-api.proto @@ -1,28 +1,29 @@ 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 { - // 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 @@ -37,18 +38,15 @@ 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; - // 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; @@ -59,54 +57,54 @@ 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; +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. - DataObject data_object = 1; + 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; @@ -114,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 DataObject data_objects = 1; + 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 DataObject data_objects = 1; + 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{},