diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-17 02:06:22 -0500 |
---|---|---|
committer | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-17 21:52:20 -0500 |
commit | 24e397b0f65b1c5294ea711a953501fda944411d (patch) | |
tree | 6a08d7863516465fc1c421cfd20805f2c209f833 /client/client.go | |
parent | a3e262f3a83fedeeabc5c7820a6d42b54e0325c1 (diff) |
add go vet test
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'client/client.go')
-rw-r--r-- | client/client.go | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/client/client.go b/client/client.go index a2107637..abc22161 100644 --- a/client/client.go +++ b/client/client.go @@ -151,13 +151,13 @@ func (cli *GoBGPClient) GetNeighbor(name string) (*config.Neighbor, error) { func (cli *GoBGPClient) AddNeighbor(c *config.Neighbor) error { peer := api.NewPeerFromConfigStruct(c) - _, err := cli.cli.AddNeighbor(context.Background(), &api.AddNeighborRequest{peer}) + _, err := cli.cli.AddNeighbor(context.Background(), &api.AddNeighborRequest{Peer: peer}) return err } func (cli *GoBGPClient) DeleteNeighbor(c *config.Neighbor) error { peer := api.NewPeerFromConfigStruct(c) - _, err := cli.cli.DeleteNeighbor(context.Background(), &api.DeleteNeighborRequest{peer}) + _, err := cli.cli.DeleteNeighbor(context.Background(), &api.DeleteNeighborRequest{Peer: peer}) return err } @@ -165,22 +165,22 @@ func (cli *GoBGPClient) DeleteNeighbor(c *config.Neighbor) error { //} func (cli *GoBGPClient) ShutdownNeighbor(addr string) error { - _, err := cli.cli.ShutdownNeighbor(context.Background(), &api.ShutdownNeighborRequest{addr}) + _, err := cli.cli.ShutdownNeighbor(context.Background(), &api.ShutdownNeighborRequest{Address: addr}) return err } func (cli *GoBGPClient) ResetNeighbor(addr string) error { - _, err := cli.cli.ResetNeighbor(context.Background(), &api.ResetNeighborRequest{addr}) + _, err := cli.cli.ResetNeighbor(context.Background(), &api.ResetNeighborRequest{Address: addr}) return err } func (cli *GoBGPClient) EnableNeighbor(addr string) error { - _, err := cli.cli.EnableNeighbor(context.Background(), &api.EnableNeighborRequest{addr}) + _, err := cli.cli.EnableNeighbor(context.Background(), &api.EnableNeighborRequest{Address: addr}) return err } func (cli *GoBGPClient) DisableNeighbor(addr string) error { - _, err := cli.cli.DisableNeighbor(context.Background(), &api.DisableNeighborRequest{addr}) + _, err := cli.cli.DisableNeighbor(context.Background(), &api.DisableNeighborRequest{Address: addr}) return err } @@ -705,20 +705,22 @@ func (cli *GoBGPClient) GetRouteServerExportPolicy(name string) (*table.PolicyAs func (cli *GoBGPClient) AddPolicyAssignment(assignment *table.PolicyAssignment) error { _, err := cli.cli.AddPolicyAssignment(context.Background(), &api.AddPolicyAssignmentRequest{ - api.NewAPIPolicyAssignmentFromTableStruct(assignment), + Assignment: api.NewAPIPolicyAssignmentFromTableStruct(assignment), }) return err } func (cli *GoBGPClient) DeletePolicyAssignment(assignment *table.PolicyAssignment, all bool) error { a := api.NewAPIPolicyAssignmentFromTableStruct(assignment) - _, err := cli.cli.DeletePolicyAssignment(context.Background(), &api.DeletePolicyAssignmentRequest{a, all}) + _, err := cli.cli.DeletePolicyAssignment(context.Background(), &api.DeletePolicyAssignmentRequest{ + Assignment: a, + All: all}) return err } func (cli *GoBGPClient) ReplacePolicyAssignment(assignment *table.PolicyAssignment) error { _, err := cli.cli.ReplacePolicyAssignment(context.Background(), &api.ReplacePolicyAssignmentRequest{ - api.NewAPIPolicyAssignmentFromTableStruct(assignment), + Assignment: api.NewAPIPolicyAssignmentFromTableStruct(assignment), }) return err } |