Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

change autonat interface to use functional options #53

Merged
merged 2 commits into from
Mar 16, 2020
Merged

Conversation

willscott
Copy link
Contributor

fix #43

Copy link
Contributor

@aschmahmann aschmahmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

autonat.go Show resolved Hide resolved
@willscott willscott mentioned this pull request Mar 13, 2020
2 tasks
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits that can be punted

return nil
}

// WithAddresses allows overriding which Addresses the AutoNAT client beliieves
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// WithAddresses allows overriding which Addresses the AutoNAT client beliieves
// WithAddresses allows overriding which Addresses the AutoNAT client believes

// are "its own". Useful for testing, or for more exotic port-forwarding
// scenarios where the host may be listening on different ports than it wants
// to externally advertise or verify connectability on.
func WithAddresses(addrFunc GetAddrs) Option {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe call this AddressGuesser? As far as I can tell, that's really what this is.

@willscott willscott merged commit 898373b into master Mar 16, 2020
@willscott willscott deleted the feat/opt branch March 16, 2020 15:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use functional options instead of global variables
3 participants