Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: clarify filter func return val meaning #2958

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions settingengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
candidates struct {
ICELite bool
ICENetworkTypes []NetworkType
InterfaceFilter func(string) bool
IPFilter func(net.IP) bool
InterfaceFilter func(string) (keep bool)
IPFilter func(net.IP) (keep bool)
NAT1To1IPs []string
NAT1To1IPCandidateType ICECandidateType
MulticastDNSMode ice.MulticastDNSMode
Expand Down Expand Up @@ -201,15 +201,15 @@
// This can be used to exclude certain network interfaces from ICE. Which may be
// useful if you know a certain interface will never succeed, or if you wish to reduce
// the amount of information you wish to expose to the remote peer
func (e *SettingEngine) SetInterfaceFilter(filter func(string) bool) {
func (e *SettingEngine) SetInterfaceFilter(filter func(string) (keep bool)) {

Check warning on line 204 in settingengine.go

View check run for this annotation

Codecov / codecov/patch

settingengine.go#L204

Added line #L204 was not covered by tests
e.candidates.InterfaceFilter = filter
}

// SetIPFilter sets the filtering functions when gathering ICE candidates
// This can be used to exclude certain ip from ICE. Which may be
// useful if you know a certain ip will never succeed, or if you wish to reduce
// the amount of information you wish to expose to the remote peer
func (e *SettingEngine) SetIPFilter(filter func(net.IP) bool) {
func (e *SettingEngine) SetIPFilter(filter func(net.IP) (keep bool)) {

Check warning on line 212 in settingengine.go

View check run for this annotation

Codecov / codecov/patch

settingengine.go#L212

Added line #L212 was not covered by tests
e.candidates.IPFilter = filter
}

Expand Down
Loading