redis

package
v0.0.0-...-fe78ce7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyLiveMatches       = "live_matches"
	KeyLiveMatchesByTime = "live_matches_by_time"
)
View Source
const (
	TopicLiveMatchesReplace       = "live_matches.replace"
	TopicLiveMatchesAdd           = "live_matches.add"
	TopicLiveMatchesUpdate        = "live_matches.update"
	TopicLiveMatchesRemove        = "live_matches.remove"
	TopicPatternLiveMatchesAll    = "live_matches.*"
	TopicLiveMatchStatsAdd        = "live_match_stats.add"
	TopicPatternLiveMatchStatsAll = "live_match_stats.*"
)

Variables

This section is empty.

Functions

func LiveMatchesToZValues

func LiveMatchesToZValues(liveMatches nscol.LiveMatches) []*redis.Z

func LiveMatchesToZValuesByTime

func LiveMatchesToZValuesByTime(liveMatches nscol.LiveMatches) []*redis.Z

Types

type ErrCommandFailure

type ErrCommandFailure struct {
	*nserr.Err

	Cmd redis.Cmder
	Key string
}

type ErrPubsubFailure

type ErrPubsubFailure struct {
	*nserr.Err

	Cmd   redis.Cmder
	Topic string
}

type PubSub

type PubSub struct {
	*redis.PubSub
}

func NewPubSub

func NewPubSub(pubsub *redis.PubSub) *PubSub

func (*PubSub) Watch

func (ps *PubSub) Watch(ctx context.Context, handler func(*redis.Message))

type Redis

type Redis struct {
	*redis.Client
}

func NewRedis

func NewRedis(c *redis.Client) *Redis

func (*Redis) AddLiveMatches

func (r *Redis) AddLiveMatches(liveMatches nscol.LiveMatches) error

func (*Redis) LiveMatchIDs

func (r *Redis) LiveMatchIDs() (nscol.MatchIDs, error)

func (*Redis) PSubscribe

func (r *Redis) PSubscribe(pattern string) (*PubSub, error)

func (*Redis) PubLiveMatchStatsAdd

func (r *Redis) PubLiveMatchStatsAdd(stats nscol.LiveMatchStats) error

func (*Redis) PubLiveMatchesAdd

func (r *Redis) PubLiveMatchesAdd(liveMatches nscol.LiveMatches) error

func (*Redis) PubLiveMatchesRemove

func (r *Redis) PubLiveMatchesRemove(matchIDs nscol.MatchIDs) error

func (*Redis) RemoveLiveMatches

func (r *Redis) RemoveLiveMatches(matchIDs nscol.MatchIDs) error

Jump to

Keyboard shortcuts

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