redis

package
v0.0.0-...-bd60060 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

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

Redis implements the icc backend by saving the data to redis.

Has to be created with redis.New().

func New

func New(addr string) *Redis

New creates a new initializes redis instance.

func (*Redis) ApplauseCleanOld

func (r *Redis) ApplauseCleanOld(olderThen int64) error

ApplauseCleanOld removes applause that is older then a given time.

func (*Redis) ApplausePublish

func (r *Redis) ApplausePublish(meetingID, userID int, time int64) error

ApplausePublish saves an applause for the user at a given time as unix time stamp.

func (*Redis) ApplauseSince

func (r *Redis) ApplauseSince(time int64) (map[int]int, error)

ApplauseSince returned all applause since a given time as unix time stamp.

func (*Redis) NotifyPublish

func (r *Redis) NotifyPublish(message []byte) error

NotifyPublish saves a valid notify message.

func (*Redis) NotifyReceive

func (r *Redis) NotifyReceive(ctx context.Context) ([]byte, error)

NotifyReceive is a blocking function that receives the messages.

The first call returnes the first notify message, the next call the second an so on. If there are no more messages to read, the function blocks until there is or the context ist canceled.

It is expected, that only one goroutine is calling this function.

func (*Redis) Wait

func (r *Redis) Wait(ctx context.Context)

Wait blocks until a connection to redis can be established.

Jump to

Keyboard shortcuts

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