pubsub

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 8 Imported by: 3

README

p2pdb-pubsub

decentralized,distributed,peer-to-peer database.

Documentation

Index

Constants

View Source
const GlobalTopic string = ("p2pdb")

Variables

This section is empty.

Functions

This section is empty.

Types

type DataMessage

type DataMessage struct {
	Type string
	Data interface{}
}

type PubSub

type PubSub struct {
	Host       host.Host
	Topic      *libpubsub.Topic
	Type       string
	SubHandler SubHandler
	// contains filtered or unexported fields
}

func (*PubSub) GetType

func (p2pdbPubSub *PubSub) GetType() string

func (*PubSub) InitPubSub added in v0.0.9

func (p2pdbPubSub *PubSub) InitPubSub(Type string, Host host.Host) PubSub

func (*PubSub) Pub

func (p2pdbPubSub *PubSub) Pub(message DataMessage)

func (*PubSub) SetHost added in v0.0.9

func (p2pdbPubSub *PubSub) SetHost(Host host.Host)

func (*PubSub) SetType

func (p2pdbPubSub *PubSub) SetType(Type string)

func (*PubSub) StartNewSubscribeService added in v0.0.3

func (p2pdbPubSub *PubSub) StartNewSubscribeService(sub *libpubsub.Subscription)

type PubSubInterface added in v0.0.7

type PubSubInterface interface {
	InitPubSub()
	GetType() string
	SetType(Type string)
	Pub(message DataMessage)
	Sub() (*libpubsub.Subscription, *libpubsub.Topic, error)
	// contains filtered or unexported methods
}

type SubHandler

type SubHandler interface {
	SubHandler(DataMessage)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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