Skip to content

Commit

Permalink
chore: add json tags to TCPAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
ajatprabha committed Jan 22, 2024
1 parent 0456a90 commit 1e72279
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (

// TCPAddress specifies Host and Port for remote broker
type TCPAddress struct {
Host string
Port uint16
Host string `json:"host"`
Port uint16 `json:"port"`
}

func (t TCPAddress) String() string { return fmt.Sprintf("%s:%d", t.Host, t.Port) }
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/sdk/SDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,8 @@ TCPAddress specifies Host and Port for remote broker

```go
type TCPAddress struct {
Host string
Port uint16
Host string `json:"host"`
Port uint16 `json:"port"`
}
```

Expand Down
4 changes: 2 additions & 2 deletions http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestClient_TelemetryHandler(t *testing.T) {
name: "single connection mode",
status: http.StatusOK,
opts: func(t *testing.T) []ClientOption { return nil },
body: fmt.Sprintf(`{"clients":[{"addresses":[{"Host":"%s","Port":%d}],"client_id":"clientID","username":"","resume_subs":false,"clean_session":false,"auto_reconnect":true,"connected":true}],"multi":false}
body: fmt.Sprintf(`{"clients":[{"addresses":[{"host":"%s","port":%d}],"client_id":"clientID","username":"","resume_subs":false,"clean_session":false,"auto_reconnect":true,"connected":true}],"multi":false}
`, testBrokerAddress.Host, testBrokerAddress.Port),
},
{
Expand Down Expand Up @@ -50,7 +50,7 @@ func TestClient_TelemetryHandler(t *testing.T) {
UseMultiConnectionMode,
}
},
body: fmt.Sprintf(`{"clients":[{"addresses":[{"Host":"%s","Port":%d}],"client_id":"clientID-0-1","username":"","resume_subs":false,"clean_session":false,"auto_reconnect":true,"connected":true},{"addresses":[{"Host":"%s","Port":%d}],"client_id":"clientID-1-1","username":"","resume_subs":false,"clean_session":false,"auto_reconnect":true,"connected":true}],"multi":true}
body: fmt.Sprintf(`{"clients":[{"addresses":[{"host":"%s","port":%d}],"client_id":"clientID-0-1","username":"","resume_subs":false,"clean_session":false,"auto_reconnect":true,"connected":true},{"addresses":[{"host":"%s","port":%d}],"client_id":"clientID-1-1","username":"","resume_subs":false,"clean_session":false,"auto_reconnect":true,"connected":true}],"multi":true}
`, testBrokerAddress.Host, testBrokerAddress.Port, testBrokerAddress.Host, testBrokerAddress.Port),
},
}
Expand Down

0 comments on commit 1e72279

Please sign in to comment.