connections

package
v0.14.16 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: MPL-2.0 Imports: 24 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection added in v0.13.0

type Connection interface {
	protocol.Connection
	io.Closer
	Type() 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 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 Model

type Model interface {
	protocol.Model
	AddConnection(conn Connection, hello protocol.HelloResult)
	ConnectedTo(remoteID protocol.DeviceID) bool
	IsPaused(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) 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