pubsub

package
v0.0.0-...-2aa8555 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRdsPubsub

func NewRdsPubsub(rdc util.Redic, queue util.Queue) *rdsPubsub

func NewTiPubsub

func NewTiPubsub(txn kv.Transaction) *tiPubsub

Types

type Option

type Option func(r *pubsubOps)

func SetRedisStore

func SetRedisStore(rdc util.Redic, queue util.Queue) Option

func SetTikvStore

func SetTikvStore(txn kv.Transaction) Option

type PubsubOps

type PubsubOps interface {
	Publish(ns, topic string, message *pbMessage.Message) ([]byte, error)
	Last(ns, topic string) ([]byte, error)
	Range(ns, topic string, pos []byte, count int64) ([]byte, []*pbMessage.Message, bool, error)

	Drop(ns, topic string) error
	SetRetain(ns, topic string, message *pbMessage.Message) error
	DeleteRetain(ns, topic string) error
	Retain(ns, topic string) (*pbMessage.Message, error)

	Subscribe(ns, topic, client string, online bool) error
	Unsubscribe(ns, topic, client string) error
	HasSubscriber(ns, topic string) (bool, error)
	ListOfflineSubscribers(ns, topic string) ([]string, error)
	ListOnlineSubscribers(ns, topic string) ([]string, error)
}

func NewPubsubOps

func NewPubsubOps(opts ...Option) PubsubOps

Jump to

Keyboard shortcuts

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