dhtdiscovery

package
v0.0.0-...-3966bfa Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRegistry

func NewRegistry() *registryDHT

NewRegistry create an instance of Broker registryBroker.

Types

type Node

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

Node represents DHT server-client in P2P network.

func NewNode

func NewNode(listenAddress string, bootstrapPeerAddresses []string) (*Node, error)

NewNode create an instance of DHT node.

func (*Node) Start

func (n *Node) Start() (err error)

Start begins DHT bootstrapping process.

func (*Node) Stop

func (n *Node) Stop()

Stop stops DHT node.

type Repository

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

Repository provides proposals from the DHT.

func NewRepository

func NewRepository() *Repository

NewRepository constructs a new proposal repository (backed by the DHT).

func (*Repository) Countries

func (r *Repository) Countries(filter *proposal.Filter) (map[string]int, error)

Countries returns proposals per country matching the filter.

func (*Repository) Proposal

Proposal returns a single proposal by its ID.

func (*Repository) Proposals

func (r *Repository) Proposals(filter *proposal.Filter) ([]market.ServiceProposal, error)

Proposals returns proposals matching the filter.

func (*Repository) Start

func (r *Repository) Start() error

Start begins proposals synchronization to storage.

func (*Repository) Stop

func (r *Repository) Stop()

Stop ends proposals synchronization to storage.

Jump to

Keyboard shortcuts

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