pubsub

package
v0.0.0-...-b2289a0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	CreateTopic(topic string) error
	RemoveTopic(topic string) error
	Subscribe(topic string) (string, <-chan string, error)
	Unsubscribe(topic string, subscriptionId string) error
	Publish(topic string, data string) error
	Close() error
}

func NewClient

func NewClient(options Options) (Client, error)

type Options

type Options struct {
	Type Type
	// to store max number of messages in channel if no subscriber is listening
	BufferLength int
	// Only for remote pubsub, to store redis client
	RedisClient       *redis.Client
	TopicsChannelName string
	EventsChannelName string
}

type Type

type Type string
const (
	Local  Type = "local"
	Remote Type = "remote"
)

Jump to

Keyboard shortcuts

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