pubsub

package
v0.0.0-...-260b785 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module deals with pub sub related activities

func New

func New(projectID, conn string) (*Module, error)

New creates a new instance of the client

func (*Module) CancelSubscription

func (m *Module) CancelSubscription(topic string)

CancelSubscription cancels an active subscription

func (*Module) CheckAndSet

func (m *Module) CheckAndSet(ctx context.Context, key, value string, ttl time.Duration) (bool, error)

CheckAndSet sets the key value pair and returns if the key already existed or not

func (*Module) CheckIfKeyExists

func (m *Module) CheckIfKeyExists(ctx context.Context, key string) (bool, error)

CheckIfKeyExists checks if the key exists

func (*Module) Close

func (m *Module) Close()

Close closes the redis client along with the active subscriptions on it

func (*Module) PublishString

func (m *Module) PublishString(ctx context.Context, topic, value string) error

PublishString delivers a message in a fire and forget fashion

func (*Module) Send

func (m *Module) Send(ctx context.Context, topic string, value interface{}) error

Send delivers a message reliably

func (*Module) SendAck

func (m *Module) SendAck(ctx context.Context, replyTo string, ack bool) error

SendAck acknowledges the receipt of a message

func (*Module) Subscribe

func (m *Module) Subscribe(ctx context.Context, topic string) (<-chan *redis.Message, error)

Subscribe creates a subscription on a topic

Jump to

Keyboard shortcuts

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