Skip to content

Commit

Permalink
fix format issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Peiyu Wu committed Jul 23, 2021
1 parent 20a2917 commit 5d6f36f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions events/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
package events

type KafkaEvent struct {
EventSource string `json:"eventSource"`
EventSourceARN string `json:"eventSourceArn"`
Records map[string][]KafkaRecord `json:"records"`
BootstrapServers string `json:"bootstrapServers"`
EventSource string `json:"eventSource"`
EventSourceARN string `json:"eventSourceArn"`
Records map[string][]KafkaRecord `json:"records"`
BootstrapServers string `json:"bootstrapServers"`
}

type KafkaRecord struct {
Topic string `json:"topic"`
Partition int64 `json:"partition"`
Offset int64 `json:"offset"`
Timestamp MilliSecondsEpochTime `json:"timestamp"`
TimestampType string `json:"timestampType"`
Key string `json:"key,omitempty"`
Value string `json:"value,omitempty"`
Headers []map[string][]byte `json:"headers"`
Topic string `json:"topic"`
Partition int64 `json:"partition"`
Offset int64 `json:"offset"`
Timestamp MilliSecondsEpochTime `json:"timestamp"`
TimestampType string `json:"timestampType"`
Key string `json:"key,omitempty"`
Value string `json:"value,omitempty"`
Headers []map[string][]byte `json:"headers"`
}
2 changes: 1 addition & 1 deletion events/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestKafkaEventMarshaling(t *testing.T) {
assert.Equal(t, 2020, utc.Year())
assert.Equal(t, record.Key, "OGQ1NTk2YjQtMTgxMy00MjM4LWIyNGItNmRhZDhlM2QxYzBj")
assert.Equal(t, record.Value, "OGQ1NTk2YjQtMTgxMy00MjM4LWIyNGItNmRhZDhlM2QxYzBj")

for _, header := range record.Headers {
for key, value := range header {
assert.Equal(t, key, "headerKey")
Expand Down

0 comments on commit 5d6f36f

Please sign in to comment.