nats

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2019 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server  string
	Verbose bool
	Net     *vnet.Net
}

Config has config parameters for NewNATS.

type DiscoverResult

type DiscoverResult struct {
	IsNatted          bool                   `json:"isNatted"`
	MappingBehavior   EndpointDependencyType `json:"mappingBehavior"`
	FilteringBehavior EndpointDependencyType `json:"filteringBehavior"`
	PortPreservation  bool                   `json:"portPreservation"`
	NATType           string                 `json:"natType"`
	ExternalIP        string                 `json:"externalIP"`
}

DiscoverResult contains a set of results from Discover method.

type EndpointDependencyType

type EndpointDependencyType uint8

EndpointDependencyType ...

const (
	// EndpointIndependent means the behavior is independent of the endpoint's address or port
	EndpointIndependent EndpointDependencyType = iota
	// EndpointAddrDependent means the behavior is dependent on the endpoint's address
	EndpointAddrDependent
	// EndpointAddrPortDependent means the behavior is dependent on the endpoint's address and port
	EndpointAddrPortDependent
	// EndpointUndefined ...
	EndpointUndefined
)

func (EndpointDependencyType) String

func (t EndpointDependencyType) String() string

type NATS

type NATS struct {
	// contains filtered or unexported fields
}

NATS a class supports NAT type discovery feature.

func NewNATS

func NewNATS(config *Config) (*NATS, error)

NewNATS creats a new instance of NATS.

func (*NATS) Discover

func (nats *NATS) Discover() (*DiscoverResult, error)

Discover performs NAT discovery process defined in RFC 5780.

Jump to

Keyboard shortcuts

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