redis

package
v0.28.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Redis   *redis.Client
	Options *redis.Options

	settings.Queue

	// https://pkg.go.dev/github.com/sirupsen/logrus#Entry
	Logger *logrus.Entry
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, opts ...ClientOpt) (*Client, error)

New returns a Queue implementation that integrates with a Redis queue instance.

func NewTest

func NewTest(installTokenKey string) (*Client, error)

NewTest returns a Queue implementation that integrates with a local Redis instance.

It's possible to override this with env variables, which gets used as a part of integration testing with the different supported backends.

This function is intended for running tests only.

func (*Client) Driver

func (c *Client) Driver() string

Driver outputs the configured queue driver.

func (*Client) EvictInstallToken

func (c *Client) EvictInstallToken(ctx context.Context, token string) error

func (*Client) GetInstallToken

func (c *Client) GetInstallToken(ctx context.Context, token string) (*models.InstallToken, error)

func (*Client) StoreInstallToken

func (c *Client) StoreInstallToken(ctx context.Context, t *models.InstallToken, timeout int32) error

StoreInstallToken computes an HMAC-SHA256 of the token and stores it in Redis with a TTL.

type ClientOpt

type ClientOpt func(*Client) error

ClientOpt represents a configuration option to initialize the queue client for Redis.

func WithAddress

func WithAddress(address string) ClientOpt

WithAddress sets the address in the queue client for Redis.

func WithCluster

func WithCluster(cluster bool) ClientOpt

WithCluster sets the clustering mode in the queue client for Redis.

func WithInstallTokenKey

func WithInstallTokenKey(key string) ClientOpt

WithInstallTokenKey sets the install token key in the cache client for Redis.

Jump to

Keyboard shortcuts

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