(current bool, peerAddress string, peerGroup string)
| 4902 | } |
| 4903 | |
| 4904 | func WatchPostUpdate(current bool, peerAddress string, peerGroup string) WatchOption { |
| 4905 | return func(o *watchOptions) { |
| 4906 | o.postUpdate = true |
| 4907 | if current { |
| 4908 | o.initPostUpdate = true |
| 4909 | } |
| 4910 | if peerAddress != "" || peerGroup != "" { |
| 4911 | o.postUpdateFilter = func(w watchEvent) bool { |
| 4912 | ev, ok := w.(*watchEventUpdate) |
| 4913 | if !ok || ev == nil { |
| 4914 | return false |
| 4915 | } |
| 4916 | if len(peerAddress) > 0 && ev.Neighbor != nil && ev.Neighbor.State.NeighborAddress == netip.MustParseAddr(peerAddress) { |
| 4917 | return true |
| 4918 | } |
| 4919 | if len(peerGroup) > 0 && ev.Neighbor != nil && ev.Neighbor.State.PeerGroup == peerGroup { |
| 4920 | return true |
| 4921 | } |
| 4922 | return false |
| 4923 | } |
| 4924 | } |
| 4925 | } |
| 4926 | } |
| 4927 | |
| 4928 | func WatchEor(current bool) WatchOption { |
| 4929 | return func(o *watchOptions) { |
no outgoing calls
searching dependent graphs…