summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-11-12 09:25:56 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-11-12 09:30:20 +0900
commit99556f9cfc2df561dcf7d91c147a129449635224 (patch)
tree7331d768c1cee74ab93041717abd03f9de9702e7 /docs
parent289fc39deb9cfa4ee678ff902d51f84c6c828136 (diff)
server: change monitor API design
https://github.com/osrg/gobgp/issues/1763#issuecomment-437594975 Follow Chris's proposal; consistent with the rest of the APIs. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'docs')
-rw-r--r--docs/sources/lib.md9
1 files changed, 1 insertions, 8 deletions
diff --git a/docs/sources/lib.md b/docs/sources/lib.md
index c76133f9..ba481797 100644
--- a/docs/sources/lib.md
+++ b/docs/sources/lib.md
@@ -39,15 +39,8 @@ func main() {
}
// monitor the change of the peer state
- if pm, err := s.NewPeerMonitor(&api.MonitorPeerRequest{}); err != nil {
+ if err := s.MonitorPeer(context.Background(), &api.MonitorPeerRequest{}, func(p *api.Peer){log.Info(p)}); err != nil {
log.Fatal(err)
- } else {
- defer pm.Close()
- go func() {
- for v := range pm.Inbox {
- log.Info(v)
- }
- }()
}
// neighbor configuration