Skip to content

Commit

Permalink
refactor: update event and sensor type (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
VaibhavPage authored Feb 25, 2020
1 parent 3883e47 commit 97d4ca7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
1 change: 1 addition & 0 deletions pkg/apis/events/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package events
14 changes: 7 additions & 7 deletions pkg/apis/events/event-data.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ type KafkaEventData struct {
// Partition refers to the Kafka partition
Partition int `json:"partition"`
// Body refers to the message value
Body []byte `json:"value"`
Body []byte `json:"body"`
// Timestamp of the message
Timestamp string `json:"timestamp"`
}
Expand All @@ -155,25 +155,25 @@ type MQTTEventData struct {
// MessageId is the unique ID for the message
MessageId int `json:"messageId"`
// Payload is the message payload.
Body []byte `json:"payload"`
Body []byte `json:"body"`
}

// NATSEventData represents the event data generated by the NATS gateway.
type NATSEventData struct {
// Name of the subject.
Subject string `json:"subject"`
// Message data.
Body []byte `json:"data"`
Body []byte `json:"body"`
}

// NSQEventData represents the event data generated by the NSQ gateway.
type NSQEventData struct {
// Body is the message data.
Body []byte
Body []byte `json:"body"`
// Timestamp of the message.
Timestamp string
Timestamp string `json:"timestamp"`
// NSQDAddress is the address of the nsq host.
NSQDAddress string
NSQDAddress string `json:"nsqdAddress"`
}

// RedisEventData represents the event data generated by the Redis gateway.
Expand All @@ -183,7 +183,7 @@ type RedisEventData struct {
// Message pattern
Pattern string `json:"pattern"`
// Message body
Body string `json:"payload"`
Body string `json:"body"`
}

// ResourceEventData represents the event data generated by the Resource gateway.
Expand Down
22 changes: 20 additions & 2 deletions pkg/apis/sensor/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 97d4ca7

Please sign in to comment.