Documentation ¶
Index ¶
- type Msg
- type Peer
- func (p *Peer) Add(conn net.Conn, id uint32, notifier chan Msg) bool
- func (p *Peer) Client(ctx context.Context, done chan struct{})
- func (p *Peer) Enqueue(msg *Msg)
- func (p *Peer) ExportTrafficCost() error
- func (p *Peer) Forward(msg *Msg)
- func (p *Peer) LogHandler(ctx context.Context)
- func (p *Peer) Remove(conn net.Conn)
- func (p *Peer) Server(ctx context.Context, done chan struct{})
- func (p *Peer) UpdateTrafficCost(id uint32, isInwards bool, size uint64)
- type PeerInfo
- type TrafficCost
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Peer ¶
type Peer struct { Id uint32 Addr string Target map[uint32]string Peers map[net.Conn]*PeerInfo Lock *sync.RWMutex Queue []*Msg QueueLock *sync.RWMutex Log bool Logger *os.File PingClient chan struct{} Traffic map[uint32]*TrafficCost TrafficLock *sync.Mutex }
func (*Peer) ExportTrafficCost ¶
func (*Peer) LogHandler ¶
Run a go-routine, used for listening to context cancellation signal and on reception closes log file handler --- part of graceful shutdown
type TrafficCost ¶
Click to show internal directories.
Click to hide internal directories.