connections

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: MPL-2.0 Imports: 29 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).

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) *service

Types

type Connection added in v0.13.0

type Connection interface {
	protocol.Connection
	Type() string
	Transport() string
	RemoteAddr() net.Addr
	Priority() int
	String() string
	Crypto() string
}

Connection is what we expose to the outside. It is a protocol.Connection that can be closed and has some metadata.

type Model

type Model interface {
	protocol.Model
	AddConnection(conn Connection, hello protocol.HelloResult)
	Connection(remoteID protocol.DeviceID) (Connection, bool)
	OnHello(protocol.DeviceID, net.Addr, protocol.HelloResult) error
	GetHello(protocol.DeviceID) protocol.HelloIntf
}

type Service added in v0.13.0

type Service interface {
	suture.Service
	Status() map[string]interface{}
	NATType() string
}

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

Jump to

Keyboard shortcuts

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