From 13e2d7ac4bdd567617130ffbafd639bb1aadc369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rich=CE=9Brd?= Date: Mon, 4 Dec 2023 16:23:04 -0400 Subject: [PATCH] feat: make `criteriaFN` public (#942) --- waku/v2/protocol/store/waku_store_client.go | 4 ++-- waku/v2/protocol/store/waku_store_protocol.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/waku/v2/protocol/store/waku_store_client.go b/waku/v2/protocol/store/waku_store_client.go index 56e7b52a..482be4ac 100644 --- a/waku/v2/protocol/store/waku_store_client.go +++ b/waku/v2/protocol/store/waku_store_client.go @@ -80,7 +80,7 @@ func (r *Result) GetMessages() []*wpb.WakuMessage { return r.Messages } -type criteriaFN = func(msg *wpb.WakuMessage) (bool, error) +type CriteriaFN = func(msg *wpb.WakuMessage) (bool, error) type HistoryRequestParameters struct { selectedPeer peer.ID @@ -399,7 +399,7 @@ func (store *WakuStore) Query(ctx context.Context, query Query, opts ...HistoryR } // Find the first message that matches a criteria. criteriaCB is a function that will be invoked for each message and returns true if the message matches the criteria -func (store *WakuStore) Find(ctx context.Context, query Query, cb criteriaFN, opts ...HistoryRequestOption) (*wpb.WakuMessage, error) { +func (store *WakuStore) Find(ctx context.Context, query Query, cb CriteriaFN, opts ...HistoryRequestOption) (*wpb.WakuMessage, error) { if cb == nil { return nil, errors.New("callback can't be null") } diff --git a/waku/v2/protocol/store/waku_store_protocol.go b/waku/v2/protocol/store/waku_store_protocol.go index 195fa7c6..b45b57e4 100644 --- a/waku/v2/protocol/store/waku_store_protocol.go +++ b/waku/v2/protocol/store/waku_store_protocol.go @@ -84,7 +84,7 @@ type Store interface { SetHost(h host.Host) Start(context.Context, *relay.Subscription) error Query(ctx context.Context, query Query, opts ...HistoryRequestOption) (*Result, error) - Find(ctx context.Context, query Query, cb criteriaFN, opts ...HistoryRequestOption) (*wpb.WakuMessage, error) + Find(ctx context.Context, query Query, cb CriteriaFN, opts ...HistoryRequestOption) (*wpb.WakuMessage, error) Next(ctx context.Context, r *Result) (*Result, error) Resume(ctx context.Context, pubsubTopic string, peerList []peer.ID) (int, error) Stop()