nat

package
v0.0.0-...-17dc85b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 2 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL