redis

package
v0.28.0-rc12 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: Apache-2.0 Imports: 16 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) EvictBuildInstallTokens

func (c *Client) EvictBuildInstallTokens(ctx context.Context, build int64) error

EvictBuildInstallTokens evicts all installation tokens associated with a build from Redis.

func (*Client) EvictInstallStatusToken

func (c *Client) EvictInstallStatusToken(ctx context.Context, build int64) error

EvictInstallStatusToken evicts the installation status token from Redis.

func (*Client) EvictInstallToken

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

EvictInstallTokens evicts the installation tokens from Redis.

func (*Client) GetInstallStatusToken

func (c *Client) GetInstallStatusToken(ctx context.Context, build int64) (string, error)

GetInstallStatusToken retrieves the installation status token from Redis.

func (*Client) GetInstallToken

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

func (*Client) GetPermissionToken

func (c *Client) GetPermissionToken(ctx context.Context, installID int64) (string, error)

GetPermissionToken retrieves the permission token from Redis.

func (*Client) StoreInstallStatusToken

func (c *Client) StoreInstallStatusToken(ctx context.Context, build int64, token string) error

StoreInstallStatusToken stores the installation status token in Redis with a TTL.

func (*Client) StoreInstallToken

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

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

func (*Client) StorePermissionToken

func (c *Client) StorePermissionToken(ctx context.Context, installID int64, token string) error

StorePermissionToken stores the permission token for a single installation 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