Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { GetAddress() (string, error) AddMapping(protocol string, lifetime int) (int, error) }
This will make it easier to mock the tests
func New ¶
func New(client NatpmpClient) Client
type ErrClientNotConnected ¶
type ErrClientNotConnected struct{}
func (*ErrClientNotConnected) Error ¶
func (n *ErrClientNotConnected) Error() string
type NatpmpClient ¶
type NatpmpClient interface { GetExternalAddress() (*natpmp.GetExternalAddressResult, error) AddPortMapping(protocol string, internalPort, externalPort, lifetime int) (*natpmp.AddPortMappingResult, error) }
type PortMappingUnavailableError ¶
type PortMappingUnavailableError struct{}
func (*PortMappingUnavailableError) Error ¶
func (n *PortMappingUnavailableError) Error() string
Click to show internal directories.
Click to hide internal directories.