Skip to content

Commit

Permalink
Update name indexer and send back cloudevents
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJoiner committed Nov 26, 2024
1 parent 23764bd commit 04bdcb5
Show file tree
Hide file tree
Showing 13 changed files with 880 additions and 346 deletions.
46 changes: 42 additions & 4 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ const docTemplate = `{
"200": {
"description": "Returns latest object data",
"schema": {
"$ref": "#/definitions/indexrepo.DataObject"
"$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage"
}
},
"400": {
Expand Down Expand Up @@ -337,7 +337,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/indexrepo.DataObject"
"$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage"
}
}
},
Expand All @@ -364,16 +364,54 @@ const docTemplate = `{
}
},
"definitions": {
"indexrepo.DataObject": {
"cloudevent.CloudEvent-json_RawMessage": {
"type": "object",
"properties": {
"data": {
"description": "Data contains domain-specific information about the event.",
"type": "array",
"items": {
"type": "integer"
}
},
"indexKey": {
"datacontenttype": {
"description": "DataContentType is an optional MIME type for the data field. We almost\nalways serialize to JSON and in that case this field is implicitly\n\"application/json\".",
"type": "string"
},
"dataschema": {
"description": "DataSchema is an optional URI pointing to a schema for the data field.",
"type": "string"
},
"dataversion": {
"description": "DataVersion is the version of the data type.",
"type": "string"
},
"id": {
"description": "ID is an identifier for the event. The combination of ID and Source must\nbe unique.",
"type": "string"
},
"producer": {
"description": "Producer is a specific instance, process or device that creates the data structure describing the CloudEvent.",
"type": "string"
},
"source": {
"description": "Source is the context in which the event happened. In a distributed system it might consist of multiple Producers.",
"type": "string"
},
"specversion": {
"description": "SpecVersion is the version of CloudEvents specification used.\nThis is always hardcoded \"1.0\".",
"type": "string"
},
"subject": {
"description": "Subject is an optional field identifying the subject of the event within\nthe context of the event producer. In practice, we always set this.",
"type": "string"
},
"time": {
"description": "Time is an optional field giving the time at which the event occurred. In\npractice, we always set this.",
"type": "string"
},
"type": {
"description": "Type describes the type of event. It should generally be a reverse-DNS\nname.",
"type": "string"
}
}
Expand Down
46 changes: 42 additions & 4 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
"200": {
"description": "Returns latest object data",
"schema": {
"$ref": "#/definitions/indexrepo.DataObject"
"$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage"
}
},
"400": {
Expand Down Expand Up @@ -328,7 +328,7 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/indexrepo.DataObject"
"$ref": "#/definitions/cloudevent.CloudEvent-json_RawMessage"
}
}
},
Expand All @@ -355,16 +355,54 @@
}
},
"definitions": {
"indexrepo.DataObject": {
"cloudevent.CloudEvent-json_RawMessage": {
"type": "object",
"properties": {
"data": {
"description": "Data contains domain-specific information about the event.",
"type": "array",
"items": {
"type": "integer"
}
},
"indexKey": {
"datacontenttype": {
"description": "DataContentType is an optional MIME type for the data field. We almost\nalways serialize to JSON and in that case this field is implicitly\n\"application/json\".",
"type": "string"
},
"dataschema": {
"description": "DataSchema is an optional URI pointing to a schema for the data field.",
"type": "string"
},
"dataversion": {
"description": "DataVersion is the version of the data type.",
"type": "string"
},
"id": {
"description": "ID is an identifier for the event. The combination of ID and Source must\nbe unique.",
"type": "string"
},
"producer": {
"description": "Producer is a specific instance, process or device that creates the data structure describing the CloudEvent.",
"type": "string"
},
"source": {
"description": "Source is the context in which the event happened. In a distributed system it might consist of multiple Producers.",
"type": "string"
},
"specversion": {
"description": "SpecVersion is the version of CloudEvents specification used.\nThis is always hardcoded \"1.0\".",
"type": "string"
},
"subject": {
"description": "Subject is an optional field identifying the subject of the event within\nthe context of the event producer. In practice, we always set this.",
"type": "string"
},
"time": {
"description": "Time is an optional field giving the time at which the event occurred. In\npractice, we always set this.",
"type": "string"
},
"type": {
"description": "Type describes the type of event. It should generally be a reverse-DNS\nname.",
"type": "string"
}
}
Expand Down
53 changes: 49 additions & 4 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,56 @@
definitions:
indexrepo.DataObject:
cloudevent.CloudEvent-json_RawMessage:
properties:
data:
description: Data contains domain-specific information about the event.
items:
type: integer
type: array
indexKey:
datacontenttype:
description: |-
DataContentType is an optional MIME type for the data field. We almost
always serialize to JSON and in that case this field is implicitly
"application/json".
type: string
dataschema:
description: DataSchema is an optional URI pointing to a schema for the data
field.
type: string
dataversion:
description: DataVersion is the version of the data type.
type: string
id:
description: |-
ID is an identifier for the event. The combination of ID and Source must
be unique.
type: string
producer:
description: Producer is a specific instance, process or device that creates
the data structure describing the CloudEvent.
type: string
source:
description: Source is the context in which the event happened. In a distributed
system it might consist of multiple Producers.
type: string
specversion:
description: |-
SpecVersion is the version of CloudEvents specification used.
This is always hardcoded "1.0".
type: string
subject:
description: |-
Subject is an optional field identifying the subject of the event within
the context of the event producer. In practice, we always set this.
type: string
time:
description: |-
Time is an optional field giving the time at which the event occurred. In
practice, we always set this.
type: string
type:
description: |-
Type describes the type of event. It should generally be a reverse-DNS
name.
type: string
type: object
internal_fetch_httphandler.indexKeyResponse:
Expand Down Expand Up @@ -180,7 +225,7 @@ paths:
"200":
description: Returns latest object data
schema:
$ref: '#/definitions/indexrepo.DataObject'
$ref: '#/definitions/cloudevent.CloudEvent-json_RawMessage'
"400":
description: Invalid request
schema:
Expand Down Expand Up @@ -233,7 +278,7 @@ paths:
description: Returns latest object data
schema:
items:
$ref: '#/definitions/indexrepo.DataObject'
$ref: '#/definitions/cloudevent.CloudEvent-json_RawMessage'
type: array
"400":
description: Invalid request
Expand Down
20 changes: 12 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.23
require (
github.com/ClickHouse/clickhouse-go/v2 v2.30.0
github.com/DIMO-Network/clickhouse-infra v0.0.3
github.com/DIMO-Network/model-garage v0.3.3
github.com/DIMO-Network/nameindexer v0.0.10-0.20241031131836-425572ba4fe9
github.com/DIMO-Network/model-garage v0.4.2
github.com/DIMO-Network/nameindexer v0.0.12-0.20241126175909-94075d731767
github.com/DIMO-Network/shared v0.11.1
github.com/aws/aws-sdk-go-v2 v1.32.2
github.com/aws/aws-sdk-go-v2/credentials v1.17.27
Expand All @@ -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
)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit 04bdcb5

Please sign in to comment.