connections

package
v0.14.40-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2017 License: MPL-2.0 Imports: 34 Imported by: 0

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 Connection added in v0.13.0

type Connection interface {
	protocol.Connection
	io.Closer
	Type() string
	Transport() string
	RemoteAddr() net.Addr
}

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)
	ConnectedTo(remoteID protocol.DeviceID) bool
	OnHello(protocol.DeviceID, net.Addr, protocol.HelloResult) error
	GetHello(protocol.DeviceID) protocol.HelloIntf
}

type Service added in v0.13.0

type Service struct {
	*suture.Supervisor
	// contains filtered or unexported fields
}

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, lans []*net.IPNet) *Service

func (*Service) AllAddresses added in v0.13.0

func (s *Service) AllAddresses() []string

func (*Service) CommitConfiguration added in v0.13.0

func (s *Service) CommitConfiguration(from, to config.Configuration) bool

func (*Service) ExternalAddresses added in v0.13.0

func (s *Service) ExternalAddresses() []string

func (*Service) NATType added in v0.14.40

func (s *Service) NATType() string

func (*Service) Status added in v0.13.0

func (s *Service) Status() map[string]interface{}

func (*Service) VerifyConfiguration added in v0.13.0

func (s *Service) VerifyConfiguration(from, to config.Configuration) error

Jump to

Keyboard shortcuts

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