connections

package
v1.23.4 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MPL-2.0 Imports: 36 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAllowedNetwork added in v0.14.27

func IsAllowedNetwork(host string, allowed []string) bool

IsAllowedNetwork returns true if the given host (IP or resolvable hostname) is in the set of allowed networks (CIDR format only).

Types

type ConnectionStatusEntry added in v1.2.0

type ConnectionStatusEntry struct {
	When  time.Time `json:"when"`
	Error *string   `json:"error"`
}

type ListenerAddresses added in v1.6.0

type ListenerAddresses struct {
	URI          *url.URL
	WANAddresses []*url.URL
	LANAddresses []*url.URL
}

type ListenerStatusEntry added in v1.2.0

type ListenerStatusEntry struct {
	Error        *string  `json:"error"`
	LANAddresses []string `json:"lanAddresses"`
	WANAddresses []string `json:"wanAddresses"`
}

type Model

type Model interface {
	protocol.Model
	AddConnection(conn protocol.Connection, hello protocol.Hello)
	NumConnections() int
	Connection(remoteID protocol.DeviceID) (protocol.Connection, bool)
	OnHello(protocol.DeviceID, net.Addr, protocol.Hello) error
	GetHello(protocol.DeviceID) protocol.HelloIntf
	DeviceStatistics() (map[protocol.DeviceID]stats.DeviceStatistics, error)
}

type Service added in v0.13.0

type Service interface {
	suture.Service
	discover.AddressLister
	ListenerStatus() map[string]ListenerStatusEntry
	ConnectionStatus() map[string]ConnectionStatusEntry
	NATType() string
}

Service listens and dials all configured unconnected devices, via supported dialers. Successful connections are handed to the model.

func NewService added in v0.13.0

func NewService(cfg config.Wrapper, myID protocol.DeviceID, mdl Model, tlsCfg *tls.Config, discoverer discover.Finder, bepProtocolName string, tlsDefaultCommonName string, evLogger events.Logger, registry *registry.Registry, keyGen *protocol.KeyGenerator) Service

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
Registry tracks connections/addresses on which we are listening on, to allow us to pick a connection/address that has a NAT port mapping.
Registry tracks connections/addresses on which we are listening on, to allow us to pick a connection/address that has a NAT port mapping.

Jump to

Keyboard shortcuts

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