Skip to content

Commit

Permalink
Add QueryOptions to api package's monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
kyhavlov committed Nov 28, 2016
1 parent 338e36c commit 8079c49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion api/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,9 @@ func (a *Agent) DisableNodeMaintenance() error {
// Monitor returns a channel which will receive streaming logs from the agent
// Providing a non-nil stopCh can be used to close the connection and stop the
// log stream
func (a *Agent) Monitor(loglevel string, stopCh chan struct{}) (chan string, error) {
func (a *Agent) Monitor(loglevel string, stopCh chan struct{}, q *QueryOptions) (chan string, error) {
r := a.c.newRequest("GET", "/v1/agent/monitor")
r.setQueryOptions(q)
if loglevel != "" {
r.params.Add("loglevel", loglevel)
}
Expand Down
2 changes: 1 addition & 1 deletion api/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ func TestAgent_Monitor(t *testing.T) {

agent := c.Agent()

logCh, err := agent.Monitor("info", nil)
logCh, err := agent.Monitor("info", nil, nil)
if err != nil {
t.Fatalf("err: %v", err)
}
Expand Down

0 comments on commit 8079c49

Please sign in to comment.