-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
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.
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) |
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.
Isn't it too big for a default value?
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.
Maybe 500ms so?
lib/lib.go
Outdated
) error { | ||
route := k.buildInviteForMembershipURL(payload.ClanID) | ||
_, err := k.sendTo(ctx, "POST", route, payload) | ||
return err |
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.
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.
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're right! This also reduces the possibility of breaking changes. I will change 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.
The solution for the response is quite generic, but will work for now.
Added the remaining khan api routes on lib