Skip to content

Commit

Permalink
Poc Headers improvements:
Browse files Browse the repository at this point in the history
- 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 antonia.trifonova@bosch.io
  • Loading branch information
Trifonova.Antonia authored and Trifonova.Antonia committed Mar 30, 2022
1 parent aacdd8b commit 16a0ee7
Show file tree
Hide file tree
Showing 8 changed files with 442 additions and 468 deletions.
4 changes: 2 additions & 2 deletions protocol/envelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package protocol
// payload, the structure is to be used as a ready to use Ditto message.
type Envelope struct {
Topic *Topic `json:"topic"`
Headers *Headers `json:"headers,omitempty"`
Headers Headers `json:"headers,omitempty"`
Path string `json:"path"`
Value interface{} `json:"value,omitempty"`
Fields string `json:"fields,omitempty"`
Expand All @@ -32,7 +32,7 @@ func (msg *Envelope) WithTopic(topic *Topic) *Envelope {
}

// WithHeaders sets the Headers of the Envelope.
func (msg *Envelope) WithHeaders(headers *Headers) *Envelope {
func (msg *Envelope) WithHeaders(headers Headers) *Envelope {
msg.Headers = headers
return msg
}
Expand Down
Loading

0 comments on commit 16a0ee7

Please sign in to comment.