Skip to content

Commit

Permalink
Merge pull request #3090 from stevekuznetsov/skuznets/expose-max-age
Browse files Browse the repository at this point in the history
client/v2: encode max_age parameter
  • Loading branch information
dims authored Apr 11, 2022
2 parents d0cd820 + 795946d commit a429676
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/v2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func (c *Client) Stats(name string, request *v2.RequestOptions) (map[string]v2.C
"count": []string{strconv.Itoa(request.Count)},
"recursive": []string{strconv.FormatBool(request.Recursive)},
}
if request.MaxAge != nil {
data.Set("max_age", request.MaxAge.String())
}

u = fmt.Sprintf("%s?%s", u, data.Encode())
if err := c.httpGetJSONData(&ret, nil, u, "stats"); err != nil {
Expand Down

0 comments on commit a429676

Please sign in to comment.