summaryrefslogtreecommitdiffhomepage
path: root/client/client.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-01-11 09:27:16 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-01-12 21:36:57 +0900
commit91beb15057e951ec7376218a4d6e176f061d6d7e (patch)
tree9ba705047a8d314e54bfb5f3abee0f067eabab30 /client/client.go
parent5ef8b8db3fd783a55a853febe1e274702056549a (diff)
client: Make MonitorNeighborState to get single argument
Currently, Client.MonitorNeighborState uses only first neighbor address even if it take variable length arguments (the second and following neighbor address is ignored implicitly). This patch fixes this function to take a single neighbor address and prevents user confusion. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'client/client.go')
-rw-r--r--client/client.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/client/client.go b/client/client.go
index 90de1c60..a48f3c17 100644
--- a/client/client.go
+++ b/client/client.go
@@ -993,14 +993,7 @@ func (c *MonitorNeighborStateClient) Recv() (*config.Neighbor, error) {
return api.NewNeighborFromAPIStruct(p)
}
-func (cli *Client) MonitorNeighborState(names ...string) (*MonitorNeighborStateClient, error) {
- if len(names) > 1 {
- return nil, fmt.Errorf("support one name at most: %d", len(names))
- }
- name := ""
- if len(names) > 0 {
- name = names[0]
- }
+func (cli *Client) MonitorNeighborState(name string) (*MonitorNeighborStateClient, error) {
stream, err := cli.cli.MonitorPeerState(context.Background(), &api.Arguments{
Name: name,
})