-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MF-1088 - Remove message payload content type #1121
Conversation
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but it will be mandatory that @dusanb94 and @nmarcetic review as well.
Docs will need update, as this breaks the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
transformers/senml/transformer.go
Outdated
func New(contentType string) transformers.Transformer { | ||
return transformer{ | ||
format: formats[contentType], | ||
} | ||
} | ||
|
||
func (n transformer) Transform(msg broker.Message) (interface{}, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can rename func (n transformer) Transform...
to func (t transformer) Transform...
. Weird receiver name n
is a legacy from Normalizer
.
transformers/senml/transformer.go
Outdated
return transformer{ | ||
format: formats[contentType], | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to have a default format (also, please rename contentType
to contentFormat
):
format, ok := formats[contentFormat]
if !ok {
format = formats[JSON]
}
return transformer {
format: format,
}
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1121 +/- ##
=======================================
Coverage 75.33% 75.33%
=======================================
Files 101 101
Lines 6853 6853
=======================================
Hits 5163 5163
Misses 1333 1333
Partials 357 357 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* MF-1088 - Remove message payload content type Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add default contentFormat Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: Manuel Imperiale manuel.imperiale@gmail.com
Resolves #1088