discovery

package
Version: v0.0.0-...-e2e7ff8 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceTag = "_ipfs-discovery._udp"

Variables

This section is empty.

Functions

This section is empty.

Types

type BleDiscoveryService

type BleDiscoveryService interface {
	HandlePeerFound(peer.AddrInfo)
	HandleLostPeer(remotePID string)
}

type NativeDriver

type NativeDriver interface {
	// Start the native driver
	Start(localPID string)

	// Stop the native driver
	Stop()

	// Check if the native driver is connected to the remote peer
	DialPeer(remotePID string) bool

	// Send data to the remote peer
	SendToPeer(remotePID string, payload []byte) bool

	// Close the connection with the remote peer
	CloseConnWithPeer(remotePID string)

	// Return the multiaddress protocol code
	ProtocolCode() int

	// Return the multiaddress protocol name
	ProtocolName() string

	// Return the default multiaddress
	DefaultAddr() string
}

type NoopNativeDriver

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

func NewNoopNativeDriver

func NewNoopNativeDriver(protocolCode int, protocolName, defaultAddr string) *NoopNativeDriver

func (*NoopNativeDriver) CloseConnWithPeer

func (d *NoopNativeDriver) CloseConnWithPeer(_ string)

func (*NoopNativeDriver) DefaultAddr

func (d *NoopNativeDriver) DefaultAddr() string

func (*NoopNativeDriver) DialPeer

func (d *NoopNativeDriver) DialPeer(_ string) bool

func (*NoopNativeDriver) ProtocolCode

func (d *NoopNativeDriver) ProtocolCode() int

func (*NoopNativeDriver) ProtocolName

func (d *NoopNativeDriver) ProtocolName() string

func (*NoopNativeDriver) SendToPeer

func (d *NoopNativeDriver) SendToPeer(_ string, _ []byte) bool

func (*NoopNativeDriver) Start

func (d *NoopNativeDriver) Start(_ string)

func (*NoopNativeDriver) Stop

func (d *NoopNativeDriver) Stop()

type Notifee

type Notifee interface {
	HandlePeerFound(peer.AddrInfo)
}

type Service

type Service interface {
	io.Closer
	RegisterNotifee(Notifee)
	UnregisterNotifee(Notifee)
}

func Init

func Init(root string, peerhost host.Host, interval time.Duration, serviceTag string) (Service, error)

Initialises the .datahop repo, if required at the given location with the given swarm port as config. Default swarm port is 4501

Jump to

Keyboard shortcuts

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