rendezvous

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const RendezvousID = rvs.RendezvousProto

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func NewDB

func NewDB(ctx context.Context, db *sql.DB, logger *zap.Logger) *DB

func (*DB) Close

func (db *DB) Close() error

func (*DB) CountRegistrations

func (db *DB) CountRegistrations(p peer.ID) (int, error)

func (*DB) Discover

func (db *DB) Discover(ns string, cookie []byte, limit int) ([]dbi.RegistrationRecord, []byte, error)

func (*DB) Register

func (db *DB) Register(p peer.ID, ns string, addrs [][]byte, ttl int) (uint64, error)

func (*DB) Start

func (db *DB) Start(ctx context.Context) error

func (*DB) Unregister

func (db *DB) Unregister(p peer.ID, ns string) error

func (*DB) ValidCookie

func (db *DB) ValidCookie(ns string, cookie []byte) bool

type PeerConnector

type PeerConnector interface {
	PeerChannel() chan<- peer.AddrInfo
}

type Rendezvous

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

func NewRendezvous

func NewRendezvous(enableServer bool, db *DB, discoverPeers bool, rendezvousPoints []peer.ID, peerConnector PeerConnector, log *zap.Logger) *Rendezvous

func (*Rendezvous) SetHost added in v0.6.0

func (r *Rendezvous) SetHost(h host.Host)

Sets the host to be able to mount or consume a protocol

func (*Rendezvous) Start

func (r *Rendezvous) Start(ctx context.Context) error

func (*Rendezvous) Stop

func (r *Rendezvous) Stop()

Jump to

Keyboard shortcuts

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