Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Advertiser ¶
type Advertiser interface { // Advertise advertises a service Advertise(ctx context.Context, ns string, opts ...Option) (time.Duration, error) }
Advertiser is an interface for advertising services
type Discoverer ¶
type Discoverer interface { // FindPeers discovers peers providing a service FindPeers(ctx context.Context, ns string, opts ...Option) (<-chan pstore.PeerInfo, error) }
Discoverer is an interface for peer discovery
type Discovery ¶
type Discovery interface { Advertiser Discoverer }
Discovery is an interface that combines service advertisement and peer discovery
type Option ¶
Option is a single discovery option
type Options ¶
type Options struct { Ttl time.Duration Limit int // Other (implementation-specific) options Other map[interface{}]interface{} }
Options is a set of discovery options
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
Click to show internal directories.
Click to hide internal directories.