pubsub

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNilConfigurer added in v0.1.6

func NewNilConfigurer() config.PubsubConfigurer

NewNilConfigurer creates an empty config.PubsubConfigurer

func NewReportingTracer added in v0.1.4

func NewReportingTracer() pubsublibp2p.EventTracer

newTracer creates an instance of psTracer

func NewSubFilter added in v0.1.3

func NewSubFilter(pattern string, limit int) (libpubsub.SubscriptionFilter, error)

NewSubFilter creates a new subscription filter that accepts topics of the given pattern

Types

type PubsubHandler added in v0.1.2

type PubsubHandler func(*pubsublibp2p.Message)

type PubsubService

type PubsubService interface {
	Pubsub() *pubsublibp2p.PubSub
	Publish(topicName string, data []byte) error
	GetTopic(topicName string) *pubsublibp2p.Topic
	GetSubscription(topicName string) *pubsublibp2p.Subscription
	UnSubscribe(topicName string) error
	Subscribe(topicName string, handler PubsubHandler, bufferSize int) error
}

func NewPubsubService

func NewPubsubService(ctx context.Context, ps *pubsublibp2p.PubSub, configurer config.PubsubConfigurer) PubsubService

type TopicConfigurer

type TopicConfigurer func(topic *pubsublibp2p.Topic)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL