transport

package
v0.0.0-...-792b9bb Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnManager

type ConnManager struct{}

ConnManager implement connmgr.ConnManager

func (*ConnManager) Close

func (*ConnManager) Close() error

Close peer

func (*ConnManager) ClosedStream

func (cm *ConnManager) ClosedStream(n network.Network, s network.Stream)

ClosedStream is called when a stream closed

func (*ConnManager) Connected

func (cm *ConnManager) Connected(n network.Network, c network.Conn)

Connected is called when a connection opened

func (*ConnManager) Disconnected

func (cm *ConnManager) Disconnected(n network.Network, c network.Conn)

Disconnected is called when a connection closed

func (*ConnManager) GetTagInfo

func (*ConnManager) GetTagInfo(peer.ID) *connmgr.TagInfo

GetTagInfo peer

func (*ConnManager) Listen

func (cm *ConnManager) Listen(n network.Network, address ma.Multiaddr)

Listen is called when network starts listening on an address

func (*ConnManager) ListenClose

func (cm *ConnManager) ListenClose(n network.Network, address ma.Multiaddr)

ListenClose is called when network stops listening on an address

func (*ConnManager) Notifee

func (cm *ConnManager) Notifee() network.Notifiee

Notifee is used to monitor changes to a connection

func (*ConnManager) OpenedStream

func (cm *ConnManager) OpenedStream(n network.Network, s network.Stream)

OpenedStream is called when a stream opened

func (*ConnManager) Protect

func (*ConnManager) Protect(peer.ID, string)

Protect peer

func (*ConnManager) TagPeer

func (*ConnManager) TagPeer(peer.ID, string, int)

TagPeer peer

func (*ConnManager) TrimOpenConns

func (*ConnManager) TrimOpenConns(ctx context.Context)

TrimOpenConns peer

func (*ConnManager) Unprotect

func (*ConnManager) Unprotect(peer.ID, string) bool

Unprotect peer

func (*ConnManager) UntagPeer

func (*ConnManager) UntagPeer(peer.ID, string)

UntagPeer peer

func (*ConnManager) UpsertTag

func (*ConnManager) UpsertTag(peer.ID, string, func(int) int)

UpsertTag peer

type Service

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

Service is the main struct backing the transport and networking

func NewService

func NewService(ctx *cli.Context) *Service

NewService reads the configuration and initializes the transport

func (*Service) Start

func (s *Service) Start() error

Start starts the transport and connects the node to peers

func (*Service) Stop

func (s *Service) Stop() error

Stop disconnects from peers

Jump to

Keyboard shortcuts

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