redis

package
v0.0.0-...-870ec01 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ErrNil = redis.Nil

Variables

View Source
var Client *redis.Client
View Source
var RateLimitScriptSHA1 string

Functions

func AuthTokenValues

func AuthTokenValues(ctx context.Context, token string) (string, error)

func GetCache

func GetCache(ctx context.Context, collection, sha1 string) ([]interface{}, error)

func GetLocker

func GetLocker() *redislock.Client

func InvalidateCache

func InvalidateCache(ctx context.Context, invalidateKey, collection, objectID, commonIndex string, objectJSON string) (int64, error)

func InvalidateCommonIndexCache

func InvalidateCommonIndexCache(ctx context.Context, collection, commonIndex string) (int64, error)

func Publish

func Publish(ctx context.Context, channel string, data interface{}) error

Publish to a redis channel

func ReloadScripts

func ReloadScripts() error

func SetCache

func SetCache(ctx context.Context, collection, sha1, commonIndex string, args ...string) (int64, error)

func Subscribe

func Subscribe(ctx context.Context, ch chan []byte, subscribeTo ...string)

Subscribe to a channel on Redis

Types

type EventApiV1ChannelEmotes

type EventApiV1ChannelEmotes struct {
	Channel string                        `json:"channel"`
	EmoteID string                        `json:"emote_id"`
	Name    string                        `json:"name"`
	Action  string                        `json:"action"`
	Actor   string                        `json:"actor"`
	Emote   *EventApiV1ChannelEmotesEmote `json:"emote"`
}

type EventApiV1ChannelEmotesEmote

type EventApiV1ChannelEmotesEmote struct {
	Name       string                            `json:"name"`
	Visibility int32                             `json:"visibility"`
	MIME       string                            `json:"mime"`
	Tags       []string                          `json:"tags"`
	Width      [4]int16                          `json:"width"`
	Height     [4]int16                          `json:"height"`
	Animated   bool                              `json:"animated"`
	URLs       [][]string                        `json:"urls"`
	Owner      EventApiV1ChannelEmotesEmoteOwner `json:"owner"`
}

type EventApiV1ChannelEmotesEmoteOwner

type EventApiV1ChannelEmotesEmoteOwner struct {
	ID          string `json:"id"`
	TwitchID    string `json:"twitch_id"`
	DisplayName string `json:"display_name"`
	Login       string `json:"login"`
}

type Message

type Message = redis.Message

type PubSub

type PubSub = redis.PubSub

type PubSubPayloadUserEmotes

type PubSubPayloadUserEmotes struct {
	Removed bool   `json:"removed"`
	ID      string `json:"id"`
	Actor   string `json:"actor"`
}

type StringCmd

type StringCmd = redis.StringCmd

type StringStringMapCmd

type StringStringMapCmd = redis.StringStringMapCmd

type Z

type Z = redis.Z

Jump to

Keyboard shortcuts

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