connections

package
v0.13.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2016 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DialerFactory

type DialerFactory func(*url.URL, *tls.Config) (*tls.Conn, error)

type LimitedReader

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

func NewReadLimiter

func NewReadLimiter(r io.Reader, b *ratelimit.Bucket) *LimitedReader

func (*LimitedReader) Read

func (r *LimitedReader) Read(buf []byte) (int, error)

type LimitedWriter

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

func NewWriteLimiter

func NewWriteLimiter(w io.Writer, b *ratelimit.Bucket) *LimitedWriter

func (*LimitedWriter) Write

func (w *LimitedWriter) Write(buf []byte) (int, error)

type ListenerFactory

type ListenerFactory func(*url.URL, *tls.Config, chan<- model.IntermediateConnection)

type Model

type Model interface {
	protocol.Model
	AddConnection(conn model.Connection, hello protocol.HelloMessage)
	ConnectedTo(remoteID protocol.DeviceID) bool
	IsPaused(remoteID protocol.DeviceID) bool
	OnHello(protocol.DeviceID, net.Addr, protocol.HelloMessage)
	GetHello(protocol.DeviceID) protocol.HelloMessage
}

type Service added in v0.13.0

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

Service listens on TLS and dials configured unconnected devices. Successful connections are handed to the model.

func NewConnectionService added in v0.12.10

func NewConnectionService(cfg *config.Wrapper, myID protocol.DeviceID, mdl Model, tlsCfg *tls.Config, discoverer discover.Finder, mappings []*nat.Mapping,
	relayService relay.Service, bepProtocolName string, tlsDefaultCommonName string, lans []*net.IPNet) *Service

func (*Service) AllAddresses added in v0.13.0

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

AllAddresses returns a list of addresses that are our best guess for where we are reachable from the local network. Same conditions as ExternalAddresses, but private IPv4 addresses are included.

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

ExternalAddresses returns a list of addresses that are our best guess for where we are reachable from the outside. As a special case, we may return one or more addresses with an empty IP address (0.0.0.0 or ::) and just port number - this means that the outside address of a NAT gateway should be substituted.

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