Skip to content
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

Initial skeleton for Tr1d1um (WIP) #1

Merged
merged 10 commits into from
Sep 15, 2017
Merged

Initial skeleton for Tr1d1um (WIP) #1

merged 10 commits into from
Sep 15, 2017

Conversation

joe94
Copy link
Member

@joe94 joe94 commented Sep 11, 2017

No description provided.

@codecov-io
Copy link

codecov-io commented Sep 11, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@e086f51). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@          Coverage Diff          @@
##             master   #1   +/-   ##
=====================================
  Coverage          ?   0%           
=====================================
  Files             ?    1           
  Lines             ?   98           
  Branches          ?    0           
=====================================
  Hits              ?    0           
  Misses            ?   98           
  Partials          ?    0
Impacted Files Coverage Δ
src/tr1d1um/tr1d1um.go 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e086f51...6f0c952. Read the comment docs.

@@ -2,23 +2,262 @@ package main

import (
"net/http"
ts "github.comcast.com/webpa/tscommon"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not want to use tscommon.

timeOut time.Duration
targetUlr string
}

func (sh *ConversionHandler) ServeHTTP(response http.ResponseWriter, request *http.Request) {
func (sh ConversionHandler) ServeHTTP(response http.ResponseWriter, request *http.Request) {
_ , err := HttpRequestToWRP(request, ioutil.ReadAll)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't convert directly to WRP, but instead convert from the WDMP format into a WRP.

@@ -52,8 +51,30 @@ func (sh ConversionHandler) ServeHTTP(response http.ResponseWriter, request *htt
}
}
*/
func ConversionHandler(resp http.ResponseWriter, req *http.Request){
Copy link
Member Author

@joe94 joe94 Sep 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schmidtw, I added this just to double check I am on the right track with respect to the process of getting the data from the request to the WDMP format to finally WRP.

}
syncList, exists = (*gs)[syncName]
return
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sync list functionality didn't gain acceptance & can/should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.


//todo: place it into wrp?
wrpMessage := wrp.Message{}
wrpMessage.Type = wrp.SimpleEventMessageType
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wrpMessage should be a wrp.SimpleRequestResponseMessageType type since you will expect a response.

Copy link
Member Author

@joe94 joe94 Sep 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schmidtw That is correct. I have fixed that. Currently, I have rearranged a few things and I am writing unit tests for the functions I have for the new commits below.

**command**: the final command based on the analysis of the parameters
**err**: it is non-nil if any required property is violated
*/
func validateSETParams(checkingForSetAttr bool, wdmp *SetWDMP, override string) (command string, err error){
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this method having in mind this description: "If you provide both value and attributes by default it will do set values" from swagger
If this description referred to the logic that applies on the device side and not in TR1D1UM, then this was a misunderstanding. @schmidtw

@schmidtw schmidtw merged commit 0e1c127 into master Sep 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants