Documentation ¶
Index ¶
- Constants
- Variables
- type ContentFilter
- type Filter
- type FilterMap
- type FilterMapItem
- type FilterParameters
- type FilterSubscribeOption
- type FilterSubscribeParameters
- type FilterSubscription
- type Option
- type Subscriber
- type Subscribers
- func (sub *Subscribers) Append(s Subscriber) int
- func (sub *Subscribers) FlagAsFailure(peerID peer.ID)
- func (sub *Subscribers) FlagAsSuccess(peerID peer.ID)
- func (sub *Subscribers) IsFailedPeer(peerID peer.ID) bool
- func (sub *Subscribers) Items(contentTopic *string) <-chan Subscriber
- func (sub *Subscribers) Length() int
- func (sub *Subscribers) RemoveContentFilters(peerID peer.ID, requestId string, ...)
- type WakuFilter
- func (wf *WakuFilter) Stop()
- func (wf *WakuFilter) Subscribe(ctx context.Context, f ContentFilter, opts ...FilterSubscribeOption) (filterID string, theFilter Filter, err error)
- func (wf *WakuFilter) Unsubscribe(ctx context.Context, contentFilter ContentFilter, peer peer.ID) error
- func (wf *WakuFilter) UnsubscribeByFilter(ctx context.Context, filter Filter) error
- func (wf *WakuFilter) UnsubscribeFilter(ctx context.Context, cf ContentFilter) error
- func (wf *WakuFilter) UnsubscribeFilterByID(ctx context.Context, filterID string) error
Constants ¶
const FilterID_v20beta1 = libp2pProtocol.ID("/vac/waku/filter/2.0.0-beta1")
FilterID_v20beta1 is the current Waku Filter protocol identifier
Variables ¶
var (
ErrNoPeersAvailable = errors.New("no suitable remote peers")
)
Functions ¶
This section is empty.
Types ¶
type ContentFilter ¶
type FilterMap ¶
func NewFilterMap ¶
func NewFilterMap() *FilterMap
func (*FilterMap) Items ¶
func (fm *FilterMap) Items() <-chan FilterMapItem
type FilterMapItem ¶
type FilterParameters ¶
type FilterParameters struct {
// contains filtered or unexported fields
}
type FilterSubscribeOption ¶
type FilterSubscribeOption func(*FilterSubscribeParameters)
func DefaultSubscribtionOptions ¶
func DefaultSubscribtionOptions() []FilterSubscribeOption
func WithAutomaticPeerSelection ¶
func WithAutomaticPeerSelection() FilterSubscribeOption
func WithFastestPeerSelection ¶
func WithFastestPeerSelection(ctx context.Context) FilterSubscribeOption
func WithPeer ¶
func WithPeer(p peer.ID) FilterSubscribeOption
type FilterSubscribeParameters ¶
type FilterSubscribeParameters struct {
// contains filtered or unexported fields
}
type FilterSubscription ¶
type Option ¶
type Option func(*FilterParameters)
func DefaultOptions ¶
func DefaultOptions() []Option
func WithTimeout ¶
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func (Subscriber) HasContentTopic ¶ added in v0.1.0
func (sub Subscriber) HasContentTopic(topic string) bool
type Subscribers ¶
func NewSubscribers ¶
func NewSubscribers(timeout time.Duration) *Subscribers
func (*Subscribers) Append ¶
func (sub *Subscribers) Append(s Subscriber) int
func (*Subscribers) FlagAsFailure ¶
func (sub *Subscribers) FlagAsFailure(peerID peer.ID)
func (*Subscribers) FlagAsSuccess ¶
func (sub *Subscribers) FlagAsSuccess(peerID peer.ID)
func (*Subscribers) IsFailedPeer ¶ added in v0.1.0
func (sub *Subscribers) IsFailedPeer(peerID peer.ID) bool
func (*Subscribers) Items ¶
func (sub *Subscribers) Items(contentTopic *string) <-chan Subscriber
func (*Subscribers) Length ¶
func (sub *Subscribers) Length() int
func (*Subscribers) RemoveContentFilters ¶
func (sub *Subscribers) RemoveContentFilters(peerID peer.ID, requestId string, contentFilters []*pb.FilterRequest_ContentFilter)
type WakuFilter ¶
func NewWakuFilter ¶
func NewWakuFilter(ctx context.Context, host host.Host, isFullNode bool, log *zap.Logger, opts ...Option) (*WakuFilter, error)
NewWakuRelay returns a new instance of Waku Filter struct setup according to the chosen parameter and options
func (*WakuFilter) Subscribe ¶
func (wf *WakuFilter) Subscribe(ctx context.Context, f ContentFilter, opts ...FilterSubscribeOption) (filterID string, theFilter Filter, err error)
Subscribe setups a subscription to receive messages that match a specific content filter
func (*WakuFilter) Unsubscribe ¶
func (wf *WakuFilter) Unsubscribe(ctx context.Context, contentFilter ContentFilter, peer peer.ID) error
Unsubscribe is used to stop receiving messages from a peer that match a content filter
func (*WakuFilter) UnsubscribeByFilter ¶ added in v0.2.0
func (wf *WakuFilter) UnsubscribeByFilter(ctx context.Context, filter Filter) error
UnsubscribeFilterByID removes a subscription to a filter node completely using using a filter. It also closes the filter channel
func (*WakuFilter) UnsubscribeFilter ¶
func (wf *WakuFilter) UnsubscribeFilter(ctx context.Context, cf ContentFilter) error
Unsubscribe filter removes content topics from a filter subscription. If all the contentTopics are removed the subscription is dropped completely
func (*WakuFilter) UnsubscribeFilterByID ¶
func (wf *WakuFilter) UnsubscribeFilterByID(ctx context.Context, filterID string) error
UnsubscribeFilterByID removes a subscription to a filter node completely using the filterID returned when the subscription was created