Documentation
¶
Index ¶
- type Client
- func (c *Client) Driver() string
- func (c *Client) EvictInstallToken(ctx context.Context, token string) error
- func (c *Client) GetCheckRuns(ctx context.Context, build *api.Build) ([]models.CheckRun, error)
- func (c *Client) GetInstallToken(ctx context.Context, token string) (*models.InstallToken, error)
- func (c *Client) GetStepCheckRuns(ctx context.Context, step *api.Step) ([]models.CheckRun, error)
- func (c *Client) StoreCheckRuns(ctx context.Context, buildID int64, checkRuns []models.CheckRun, ...) error
- func (c *Client) StoreInstallToken(ctx context.Context, t *models.InstallToken, timeout int32) error
- func (c *Client) StoreStepCheckRuns(ctx context.Context, stepID int64, checkRuns []models.CheckRun, repo *api.Repo) 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) EvictInstallToken ¶
func (*Client) GetCheckRuns ¶
GetCheckRuns retrieves the check run info from Redis for a given build ID.
func (*Client) GetInstallToken ¶
func (*Client) GetStepCheckRuns ¶
GetStepCheckRuns retrieves the check run info from Redis for a given step ID.
func (*Client) StoreCheckRuns ¶
func (c *Client) StoreCheckRuns(ctx context.Context, buildID int64, checkRuns []models.CheckRun, repo *api.Repo) error
StoreCheckRuns stores the check runs in Redis with a TTL.
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 ¶
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.