mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-01-03 22:43:09 +00:00
feat: make criteriaFN public (#942)
This commit is contained in:
parent
16d59f37d0
commit
13e2d7ac4b
@ -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")
|
||||
}
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user