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

Add support for querying the events-log plugin #10

Merged
merged 13 commits into from
Aug 2, 2016
Prev Previous commit
Next Next commit
some minor cleanups to var names
  • Loading branch information
opalmer committed Jul 30, 2016
commit 13c94424bd1474d130e523c8ecbf4887bd6f4284
7 changes: 3 additions & 4 deletions events.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@ type EventsLogOptions struct {
// getURL returns the url that should be used in the request. This will vary
// depending on the options provided to GetEvents.
func (events *EventsLogService) getURL(options *EventsLogOptions) (string, error) {
parsedUrl, err := url.Parse("/plugins/events-log/events/")

url, err := url.Parse("/plugins/events-log/events/")
if err != nil {
return "", err
}

query := parsedUrl.Query()
query := url.Query()

if options.From != nil {
query.Set("t1", options.From.Format("2006-01-02 15:04:05"))
Expand All @@ -94,7 +93,7 @@ func (events *EventsLogService) getURL(options *EventsLogOptions) (string, error
query.Set("t2", options.To.Format("2006-01-02 15:04:05"))
}

return parsedUrl.String(), nil
return url.String(), nil
}

// GetEvents returns a list of events for the given input options. Use of this
Expand Down