Skip to content

Commit 2549a95

Browse files
refactor: Change mqtt Subject to Topic
1 parent 8a817e9 commit 2549a95

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ingester.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type ingester struct {
1212
valueEmitter valueEmitter
1313

1414
// Mutable
15-
// Stores a list of subject names that have been subscribed to.
15+
// Stores a list of topic names that have been subscribed to.
1616
topics map[string]map[uuid.UUID]bool
1717
mux *sync.RWMutex
1818
}
@@ -43,9 +43,9 @@ func (i *ingester) refreshSubscriptions(recs []rec) {
4343

4444
toSubscribe := []topicAndId{}
4545
for _, record := range recs {
46-
topic, ok := record.Tags["mqttSubject"].(string)
46+
topic, ok := record.Tags["mqttTopic"].(string)
4747
if !ok {
48-
log.Printf("Error asserting type for mqttSubject")
48+
log.Printf("Error asserting type for mqttTopic")
4949
continue
5050
}
5151

ingester_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ func (suite *IngesterTestSuite) TestIngester() {
3737
rec1 := rec{
3838
ID: uuid.New(),
3939
Tags: map[string]interface{}{
40-
"mqttSubject": "test",
40+
"mqttTopic": "test",
4141
},
4242
}
4343
rec2 := rec{
4444
ID: uuid.New(),
4545
Tags: map[string]interface{}{
46-
"mqttSubject": "test",
46+
"mqttTopic": "test",
4747
},
4848
}
4949
rec3 := rec{
5050
ID: uuid.New(),
5151
Tags: map[string]interface{}{
52-
"mqttSubject": "test2",
52+
"mqttTopic": "test2",
5353
},
5454
}
5555

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ func main() {
109109
currentStore,
110110
&valueEmitter,
111111
)
112-
recs, err := recStore.readRecs("mqttSubject")
112+
recs, err := recStore.readRecs("mqttTopic")
113113
if err != nil {
114-
log.Fatalf("error getting mqttSubject points: %s", err)
114+
log.Fatalf("error getting mqttTopic points: %s", err)
115115
}
116116
ingester.refreshSubscriptions(recs)
117117

0 commit comments

Comments
 (0)