Documentation ¶
Overview ¶
Package network handles incoming network connections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionEstablisher ¶
type ConnectionEstablisher struct {
// contains filtered or unexported fields
}
ConnectionEstablisher periodically triggers the EstablishNewConnections application command.
func NewConnectionEstablisher ¶
func NewConnectionEstablisher( handler EstablishNewConnectionsCommandHandler, logger logging.Logger, ) *ConnectionEstablisher
type Discoverer ¶
type Discoverer struct {
// contains filtered or unexported fields
}
Discoverer receives local UDP announcements from other Secure Scuttlebutt clients and passes them to the ProcessNewLocalDiscovery command.
func NewDiscoverer ¶
func NewDiscoverer( discoverer *local.Discoverer, handler ProcessNewLocalDiscoveryCommandHandler, logger logging.Logger, ) *Discoverer
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener handles incoming TCP connections initiated by other peers, initializes them and passes them to the AcceptNewPeer command.
func NewListener ¶
func NewListener( initializer ServerPeerInitializer, address string, logger logging.Logger, ) (*Listener, error)
NewListener creates a new listener which listens on the provided address. The address should be formatted in the way which can be handled by the net package e.g. ":8008".
type ProcessNewLocalDiscoveryCommandHandler ¶
type ProcessNewLocalDiscoveryCommandHandler interface {
Handle(ctx context.Context, cmd commands.ProcessNewLocalDiscovery) error
}
type ServerPeerInitializer ¶
type ServerPeerInitializer interface { // InitializeServerPeer initializes incoming connections by performing a // handshake and establishing an RPC connection using the provided // ReadWriteCloser. Context is used as the RPC connection context. InitializeServerPeer(ctx context.Context, rwc io.ReadWriteCloser) (transport.Peer, error) }
Click to show internal directories.
Click to hide internal directories.