Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type DiscoverProtocol ¶
type DiscoverProtocol struct {
// contains filtered or unexported fields
}
DiscoverProtocol handles Global and Local Sonr Peer Exchange Protocol
func New ¶
func New(ctx context.Context, host host.HostImpl, cb config.CallbackImpl, options ...Option) (*DiscoverProtocol, error)
New creates new DiscoveryProtocol
func (*DiscoverProtocol) Close ¶
func (p *DiscoverProtocol) Close() error
Close method closes the ExchangeProtocol
func (*DiscoverProtocol) Get ¶
func (p *DiscoverProtocol) Get(sname string) (*types.Peer, error)
FindPeerId method returns PeerID by SName
func (*DiscoverProtocol) Put ¶
func (p *DiscoverProtocol) Put(peer *types.Peer) error
Put method updates peer instance in the store
func (*DiscoverProtocol) Update ¶
func (p *DiscoverProtocol) Update() error
Update method publishes peer data to the topic
type LobbyEvent ¶
LobbyEvent is either Peer Update or Exit in Topic
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
Local is the protocol for managing local peers.
type Option ¶
type Option func(*options)
Option is a function that can be applied to ExchangeProtocol config
func DisableAutoPush ¶
func DisableAutoPush() Option
DisableAutoPush disables the auto push of the Lobby for OLC
func WithInterval ¶
WithInterval sets the interval of the Topic for Local OLC
func WithLocation ¶
WithLocation sets the location of the Topic for Local OLC
Click to show internal directories.
Click to hide internal directories.