WithRemoteIPFilter sets a filter for remote candidate IP addresses. Candidates for which this function returns false are ignored.
(filter func(net.IP) bool)
| 500 | // WithRemoteIPFilter sets a filter for remote candidate IP addresses. |
| 501 | // Candidates for which this function returns false are ignored. |
| 502 | func WithRemoteIPFilter(filter func(net.IP) bool) AgentOption { |
| 503 | return func(a *Agent) error { |
| 504 | if a.constructed { |
| 505 | return ErrAgentOptionNotUpdatable |
| 506 | } |
| 507 | |
| 508 | a.remoteIPFilter = filter |
| 509 | |
| 510 | return nil |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | // WithNet sets the underlying network implementation for the agent. |
| 515 | func WithNet(net transport.Net) AgentOption { |
no outgoing calls
searching dependent graphs…