Skip to content

Commit 16a0ee7

Browse files
Trifonova.AntoniaTrifonova.Antonia
Trifonova.Antonia
authored and
Trifonova.Antonia
committed
Poc Headers improvements:
- change header type to map - provide the functionality for case-insensitive - change timeout getter and setter method to expect time.Duration type - improve the getter methods to return default value (if this value is presented) - improve the test scenarios Signed-off-by: Antonia Trifonova [email protected]
1 parent aacdd8b commit 16a0ee7

8 files changed

+442
-468
lines changed

protocol/envelope.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ package protocol
1515
// payload, the structure is to be used as a ready to use Ditto message.
1616
type Envelope struct {
1717
Topic *Topic `json:"topic"`
18-
Headers *Headers `json:"headers,omitempty"`
18+
Headers Headers `json:"headers,omitempty"`
1919
Path string `json:"path"`
2020
Value interface{} `json:"value,omitempty"`
2121
Fields string `json:"fields,omitempty"`
@@ -32,7 +32,7 @@ func (msg *Envelope) WithTopic(topic *Topic) *Envelope {
3232
}
3333

3434
// WithHeaders sets the Headers of the Envelope.
35-
func (msg *Envelope) WithHeaders(headers *Headers) *Envelope {
35+
func (msg *Envelope) WithHeaders(headers Headers) *Envelope {
3636
msg.Headers = headers
3737
return msg
3838
}

0 commit comments

Comments
 (0)