Skip to content

Commit

Permalink
feat: detach WithMsgIdFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan authored and vyzo committed Jan 23, 2022
1 parent f9b2412 commit fcbbfd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/libp2p/go-libp2p-core/protocol"

logging "github.com/ipfs/go-log"
timecache "github.com/whyrusleeping/timecache"
"github.com/whyrusleeping/timecache"
)

// DefaultMaximumMessageSize is 1mb.
Expand Down Expand Up @@ -1161,7 +1161,7 @@ type TopicOptions struct{}
type TopicOpt func(t *Topic) error

// WithMsgIdFunction sets custom MsgIdFunction for a Topic, enabling topics to have own msg id generation rules.
func (p *PubSub) WithMsgIdFunction(msgId MsgIdFunction) TopicOpt {
func WithMsgIdFunction(msgId MsgIdFunction) TopicOpt {
return func(t *Topic) error {
t.p.idGen.Set(t.topic, msgId)
return nil
Expand Down

0 comments on commit fcbbfd8

Please sign in to comment.