-
Notifications
You must be signed in to change notification settings - Fork 314
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
Improvement/refactor discovery related stuff #610
Conversation
e24643b
to
8033754
Compare
cmd/di.go
Outdated
@@ -70,7 +70,7 @@ type Dependencies struct { | |||
Node *node.Node | |||
|
|||
NetworkDefinition metadata.NetworkDefinition | |||
MysteriumClient server.Client | |||
MysteriumApi *mysterium.MysteriumApi |
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.
Can we call it MysteriumAPI
to follow https://github.com/golang/go/wiki/CodeReviewComments#initialisms and keep acronyms in the consistent case?
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.
👍
market/mysterium/mysterium_api.go
Outdated
@@ -50,22 +49,23 @@ func newHTTPTransport(requestTimeout time.Duration) HTTPTransport { | |||
} | |||
} | |||
|
|||
type mysteriumAPI struct { | |||
// MysteriumApi provides access to mysterium owned central discovery service | |||
type MysteriumApi struct { |
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.
type MysteriumApi should be MysteriumAPI (golint)
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.
👍 fixed
8033754
to
8039578
Compare
I would say |
if f() { | ||
return nil | ||
} | ||
func waitForChannel(ch chan bool, duration time.Duration) 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.
We could have this as a general function somewhere in utils.
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.
Probably. But not worth it at the moment.
@@ -15,7 +15,7 @@ | |||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
*/ | |||
|
|||
// Tequila API | |||
// Package tequilapi Tequila 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.
can we add a proper description here since we're already changing it?
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.
What do you call proper description? This change was made to make golint happy.
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.
Something along the lines of Package tequilapi contains the Tequila API http server as well as a client for interacting with it
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.
I wonder how it look in swagger docs. As this first line is important for godoc and for swagger too.
3adc734
to
c5ce19e
Compare
c5ce19e
to
9b018fb
Compare
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
One biggest pains, which asked for refactoring:
Bonus: almost all packages are golint'ed :)
Question: which sounds better? proposals.ServiceProposal or market.ServiceProposal ? In second case I will move proposals up one package (to market)