Documentation
¶
Index ¶
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 )
Variables ¶
View Source
var (
DiscoverAsyncInterval = 2 * time.Minute
)
Functions ¶
Types ¶
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)
}
func NewRendezvousClient ¶
func NewRendezvousClient(host host.Host, rp peer.ID) RendezvousClient
func NewRendezvousClientWithPoint ¶
func NewRendezvousClientWithPoint(rp RendezvousPoint) 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)
}
func NewRendezvousPoint ¶
func NewRendezvousPoint(host host.Host, p peer.ID) RendezvousPoint
type RendezvousService ¶
func NewRendezvousService ¶
func NewRendezvousService(host host.Host, db db.DB, rzs ...RendezvousSync) *RendezvousService
Click to show internal directories.
Click to hide internal directories.