go-libp2p-rendezvous/sync_iface.go
Guillaume Louvigny 10a9ad4472 feat: support for sync clients
Signed-off-by: Guillaume Louvigny <glouvigny@users.noreply.github.com>
2022-08-08 17:15:13 +02:00

22 lines
499 B
Go

package rendezvous
import (
"context"
"github.com/libp2p/go-libp2p-core/peer"
)
type RendezvousSync interface {
Register(p peer.ID, ns string, addrs [][]byte, ttl int, counter uint64)
Unregister(p peer.ID, ns string)
}
type RendezvousSyncSubscribable interface {
Subscribe(ns string) (syncDetails string, err error)
GetServiceType() string
}
type RendezvousSyncClient interface {
Subscribe(ctx context.Context, syncDetails string) (<-chan *Registration, error)
GetServiceType() string
}