From 475408633a2e3bce49b5479e5ea750c5b17197bf Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Mon, 28 Nov 2016 16:13:49 -0500 Subject: [PATCH] Add QueryOptions to api package's monitor --- api/agent.go | 3 ++- api/agent_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/agent.go b/api/agent.go index 6b6166635..17eed81b1 100644 --- a/api/agent.go +++ b/api/agent.go @@ -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) } diff --git a/api/agent_test.go b/api/agent_test.go index 970380565..cc16f990f 100644 --- a/api/agent_test.go +++ b/api/agent_test.go @@ -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) }