2023-10-30 12:30:25 -04:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-22 19:35:20 +08:00
|
|
|
// WithDefaultPubsubTopic is used to indicate that the message should be broadcasted in the default pubsub topic
|
2023-10-30 12:30:25 -04:00
|
|
|
func WithDefaultPubsubTopic() PublishOption {
|
|
|
|
return func(params *publishParameters) {
|
|
|
|
params.pubsubTopic = DefaultWakuTopic
|
|
|
|
}
|
|
|
|
}
|