pubsubconn

package
v0.0.0-...-6b2b62e Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package pubsubconn provides pubsubconn for chestnut.

Package pubsubconn provides pubsubconn for chestnut.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain interface {
	HandleTrx(trx *chestnutpb.Trx) error
	HandleBlock(block *chestnutpb.Block) error
}

type P2pPubSubConn

type P2pPubSubConn struct {
	Cid          string
	Topic        *pubsub.Topic
	Subscription *pubsub.Subscription

	Ctx context.Context
	// contains filtered or unexported fields
}

func InitP2pPubSubConn

func InitP2pPubSubConn(ctx context.Context, ps *pubsub.PubSub, nodename string) *P2pPubSubConn

func (*P2pPubSubConn) JoinChannel

func (psconn *P2pPubSubConn) JoinChannel(cId string, chain Chain) error

func (*P2pPubSubConn) Publish

func (psconn *P2pPubSubConn) Publish(data []byte) error

type PubSubConn

type PubSubConn interface {
	JoinChannel(cId string, chain Chain) error
	Publish(data []byte) error
}

Jump to

Keyboard shortcuts

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