Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion events.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,19 @@ func (client *Client) GetEvent(id int) (*Event, error) {
}

// GetEvents returns a slice of events from the query stream.
// unaggregated was added on as variadic to allow a non-breaking change.
// if addtional parameters are needed this will need to be changed to a struct input or fully variadic.
func (client *Client) GetEvents(start, end int,
priority, sources, tags string) ([]Event, error) {
priority, sources, tags string, unaggregated ...bool) ([]Event, error) {
// Since this is a GET request, we need to build a query string.
vals := url.Values{}
vals.Add("start", strconv.Itoa(start))
vals.Add("end", strconv.Itoa(end))

if len(unaggregated) > 0 {
vals.Add("unaggregated", strconv.FormatBool(unaggregated[0]))
}

if priority != "" {
vals.Add("priority", priority)
}
Expand Down