p2p

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyncMsgRegType = iota
	SyncMsgRenewType
	SyncMsgCancelType
)
View Source
const DefaultEndpoint = "127.0.0.1:8005"

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

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

peer

func NewPeerEndpoint

func NewPeerEndpoint(endpoint string) (*Peer, error)

new a peer with endpoint

type PeerPool

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

peer pool

func NewPeerPoolWithEndpoints

func NewPeerPoolWithEndpoints(endpoints []string) (*PeerPool, error)

new a peer pool with endpoints

func (*PeerPool) PushMsg

func (pool *PeerPool) PushMsg(msg *SyncMsg)

push a sync message

func (*PeerPool) Start

func (pool *PeerPool) Start()

start the peer pool

type SyncMsg

type SyncMsg struct {
	Type    SyncMsgType
	Content interface{}
}

sync message

type SyncMsgType

type SyncMsgType int32

Jump to

Keyboard shortcuts

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