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) Close

func (m *Module) Close()

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

func (*Module) GetKey

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

GetKey gets value of specified key from database

func (*Module) RenewKeyTTLOnMatch

func (m *Module) RenewKeyTTLOnMatch(ctx context.Context, key, value string, t time.Duration) error

RenewKeyTTLOnMatch renews the ttl of the key if it exists & its value matches

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) SetKeyIfNotExists

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

SetKeyIfNotExists set key in redis if not exists

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