routing

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscoveryRouting

type DiscoveryRouting struct {
	discovery.Discovery
	// contains filtered or unexported fields
}

func NewDiscoveryRouting

func NewDiscoveryRouting(disc discovery.Discovery, opts ...discovery.Option) *DiscoveryRouting

func (*DiscoveryRouting) FindProvidersAsync

func (r *DiscoveryRouting) FindProvidersAsync(ctx context.Context, c cid.Cid, limit int) <-chan peer.AddrInfo

func (*DiscoveryRouting) Provide

func (r *DiscoveryRouting) Provide(ctx context.Context, c cid.Cid, bcast bool) error

type RoutingDiscovery

type RoutingDiscovery struct {
	routing.ContentRouting
}

RoutingDiscovery is an implementation of discovery using ContentRouting. Namespaces are translated to Cids using the SHA256 hash.

func NewRoutingDiscovery

func NewRoutingDiscovery(router routing.ContentRouting) *RoutingDiscovery

func (*RoutingDiscovery) Advertise

func (d *RoutingDiscovery) Advertise(ctx context.Context, ns string, opts ...discovery.Option) (time.Duration, error)

func (*RoutingDiscovery) FindPeers

func (d *RoutingDiscovery) FindPeers(ctx context.Context, ns string, opts ...discovery.Option) (<-chan peer.AddrInfo, error)

Jump to

Keyboard shortcuts

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