mirror of https://github.com/status-im/go-waku.git
23 lines
670 B
Go
23 lines
670 B
Go
package relay
|
|
|
|
type publishParameters struct {
|
|
pubsubTopic string
|
|
}
|
|
|
|
// PublishOption is the type of options accepted when publishing WakuMessages
|
|
type PublishOption func(*publishParameters)
|
|
|
|
// WithPubSubTopic is used to specify the pubsub topic on which a WakuMessage will be broadcasted
|
|
func WithPubSubTopic(pubsubTopic string) PublishOption {
|
|
return func(params *publishParameters) {
|
|
params.pubsubTopic = pubsubTopic
|
|
}
|
|
}
|
|
|
|
// WithPubSubTopic is used to indicate that the message should be broadcasted in the default pubsub topic
|
|
func WithDefaultPubsubTopic() PublishOption {
|
|
return func(params *publishParameters) {
|
|
params.pubsubTopic = DefaultWakuTopic
|
|
}
|
|
}
|