libp2p

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PubSub

type PubSub[T any] struct {
	// contains filtered or unexported fields
}

func NewPubSub

func NewPubSub[T any](params PubSubParams) (*PubSub[T], error)

func (*PubSub[T]) Close

func (p *PubSub[T]) Close(ctx context.Context) (err error)

func (*PubSub[T]) Publish

func (p *PubSub[T]) Publish(ctx context.Context, message T) error

func (*PubSub[T]) Subscribe

func (p *PubSub[T]) Subscribe(ctx context.Context, subscriber pubsub.Subscriber[T]) (err error)

type PubSubParams

type PubSubParams struct {
	Host        host.Host
	TopicName   string
	PubSub      *libp2p_pubsub.PubSub
	IgnoreLocal bool
}

Jump to

Keyboard shortcuts

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