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

Feature/new lib routes #25

Merged
merged 3 commits into from
Oct 16, 2018
Merged

Feature/new lib routes #25

merged 3 commits into from
Oct 16, 2018

Conversation

henrod
Copy link
Contributor

@henrod henrod commented Oct 15, 2018

Added the remaining khan api routes on lib

Copy link
Contributor

@cscatolini cscatolini left a comment

Choose a reason for hiding this comment

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

A few comments before proceeding

lib/lib.go Outdated
@@ -42,9 +42,9 @@ func getHTTPClient(timeoutMs int) *http.Client {

// NewKhan returns a new khan API application
func NewKhan(config *viper.Viper) KhanInterface {
config.SetDefault("khan.timeout", 1000)
config.SetDefault("khan.timeout", 1*time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it too big for a default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe 500ms so?

lib/lib.go Outdated
) error {
route := k.buildInviteForMembershipURL(payload.ClanID)
_, err := k.sendTo(ctx, "POST", route, payload)
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure we won't need the reply for this and other methods such as ApproveDenyMembershipApplication? I would rather return the response everywhere and the client application can choose to ignore it if necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! This also reduces the possibility of breaking changes. I will change it

Copy link
Contributor

@cscatolini cscatolini left a comment

Choose a reason for hiding this comment

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

The solution for the response is quite generic, but will work for now.

@cscatolini cscatolini merged commit a1ff1a1 into master Oct 16, 2018
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.

2 participants