Documentation
¶
Index ¶
- type Client
- func (c *Client) Driver() string
- func (c *Client) EvictBuildInstallTokens(ctx context.Context, build int64) error
- func (c *Client) EvictInstallStatusToken(ctx context.Context, build int64) error
- func (c *Client) EvictInstallToken(ctx context.Context, token string) error
- func (c *Client) GetInstallStatusToken(ctx context.Context, build int64) (string, error)
- func (c *Client) GetInstallToken(ctx context.Context, token string) (*models.InstallToken, error)
- func (c *Client) GetPermissionToken(ctx context.Context, installID int64) (string, error)
- func (c *Client) StoreInstallStatusToken(ctx context.Context, build int64, token string) error
- func (c *Client) StoreInstallToken(ctx context.Context, t *models.InstallToken, build int64, timeout int32) error
- func (c *Client) StorePermissionToken(ctx context.Context, installID int64, token string) error
- type ClientOpt
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 NewTest ¶
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) EvictBuildInstallTokens ¶
EvictBuildInstallTokens evicts all installation tokens associated with a build from Redis.
func (*Client) EvictInstallStatusToken ¶
EvictInstallStatusToken evicts the installation status token from Redis.
func (*Client) EvictInstallToken ¶
EvictInstallTokens evicts the installation tokens from Redis.
func (*Client) GetInstallStatusToken ¶
GetInstallStatusToken retrieves the installation status token from Redis.
func (*Client) GetInstallToken ¶
func (*Client) GetPermissionToken ¶
GetPermissionToken retrieves the permission token from Redis.
func (*Client) StoreInstallStatusToken ¶
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.
type ClientOpt ¶
ClientOpt represents a configuration option to initialize the queue client for Redis.
func WithAddress ¶
WithAddress sets the address in the queue client for Redis.
func WithCluster ¶
WithCluster sets the clustering mode in the queue client for Redis.
func WithInstallTokenKey ¶
WithInstallTokenKey sets the install token key in the cache client for Redis.