Documentation ¶
Index ¶
- Constants
- Variables
- func NewDiscoverMessage(ns string, limit int, cookie []byte) *pb.Message
- func NewRegisterMessage(ns string, pi peer.AddrInfo, ttl int) *pb.Message
- func NewRendezvousDiscovery(host host.Host, rendezvousPeer peer.ID) discovery.Discovery
- func NewSyncInMemClient(ctx context.Context, h host.Host) *client
- type AddrsFactory
- type PubSub
- type PubSubSubscribers
- type PubSubSubscriptionDetails
- type Registration
- type RendezvousClient
- type RendezvousError
- type RendezvousPoint
- type RendezvousPointOption
- type RendezvousService
- type RendezvousSync
- type RendezvousSyncClient
- type RendezvousSyncSubscribable
Constants ¶
View Source
const ( RendezvousProto = protocol.ID("/rendezvous/1.0.0") DefaultTTL = 2 * 3600 // 2hr )
View Source
const ( MaxTTL = 72 * 3600 // 72hr MaxNamespaceLength = 256 MaxPeerAddressLength = 2048 MaxRegistrations = 1000 MaxDiscoverLimit = 1000 )
View Source
const ( ServiceType = "inmem" ServiceProto = protocol.ID("/rendezvous/sync/inmem/1.0.0") )
Variables ¶
View Source
var DefaultAddrFactory = func(addrs []ma.Multiaddr) []ma.Multiaddr { return addrs }
View Source
var DiscoverAsyncInterval = 2 * time.Minute
Functions ¶
func NewRendezvousDiscovery ¶
Types ¶
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
func (*PubSub) GetServiceType ¶
type PubSubSubscribers ¶
type PubSubSubscribers struct {
// contains filtered or unexported fields
}
type RendezvousClient ¶
type RendezvousClient interface { Register(ctx context.Context, ns string, ttl int) (time.Duration, error) Unregister(ctx context.Context, ns string) error Discover(ctx context.Context, ns string, limit int, cookie []byte) ([]peer.AddrInfo, []byte, error) DiscoverAsync(ctx context.Context, ns string) (<-chan peer.AddrInfo, error) DiscoverSubscribe(ctx context.Context, ns string) (<-chan peer.AddrInfo, error) }
func NewRendezvousClient ¶
func NewRendezvousClient(host host.Host, rp peer.ID, sync ...RendezvousSyncClient) RendezvousClient
func NewRendezvousClientWithPoint ¶
func NewRendezvousClientWithPoint(rp RendezvousPoint, syncClientList ...RendezvousSyncClient) RendezvousClient
type RendezvousError ¶
type RendezvousError struct { Status pb.Message_ResponseStatus Text string }
func (RendezvousError) Error ¶
func (e RendezvousError) Error() string
type RendezvousPoint ¶
type RendezvousPoint interface { Register(ctx context.Context, ns string, ttl int) (time.Duration, error) Unregister(ctx context.Context, ns string) error Discover(ctx context.Context, ns string, limit int, cookie []byte) ([]Registration, []byte, error) DiscoverAsync(ctx context.Context, ns string) (<-chan Registration, error) DiscoverSubscribe(ctx context.Context, ns string, serviceTypes []RendezvousSyncClient) (<-chan peer.AddrInfo, error) }
func NewRendezvousPoint ¶
func NewRendezvousPoint(host host.Host, p peer.ID, opts ...RendezvousPointOption) RendezvousPoint
type RendezvousPointOption ¶ added in v0.4.1
type RendezvousPointOption func(cfg *rendezvousPointConfig)
func ClientWithAddrsFactory ¶ added in v0.4.1
func ClientWithAddrsFactory(factory AddrsFactory) RendezvousPointOption
AddrsFactory configures libp2p to use the given address factory.
type RendezvousService ¶
func NewRendezvousService ¶
func NewRendezvousService(host host.Host, db db.DB, rzs ...RendezvousSync) *RendezvousService
type RendezvousSync ¶
type RendezvousSyncClient ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.