Documentation
¶
Overview ¶
Package redis provides the ability for Vela to integrate with a Redis server as a queue backend.
Usage:
import "github.com/go-vela/server/queue/redis"
Index ¶
- type Client
- func (c *Client) Driver() string
- func (c *Client) GetSettings() settings.Queue
- func (c *Client) Length(ctx context.Context) (int64, error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) Pop(ctx context.Context, inRoutes []string) (*models.Item, error)
- func (c *Client) Push(ctx context.Context, route string, item []byte) error
- func (c *Client) Route(w *pipeline.Worker) (string, error)
- func (c *Client) RouteLength(ctx context.Context, route string) (int64, error)
- func (c *Client) SetSettings(s *settings.Platform)
- type ClientOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.27.0
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) GetSettings ¶ added in v0.27.0
GetSettings retrieves the api settings type in the Engine.
func (*Client) Length ¶ added in v0.27.0
Length tallies all items present in the configured routes in the queue.
func (*Client) Route ¶ added in v0.27.0
Route decides which route a build gets placed within the queue.
func (*Client) RouteLength ¶ added in v0.27.0
RouteLength returns count of all items present in the given route.
func (*Client) SetSettings ¶ added in v0.27.0
SetSettings sets the api settings type in the Engine.
type ClientOpt ¶ added in v0.11.0
ClientOpt represents a configuration option to initialize the queue client for Redis.
func WithAddress ¶ added in v0.11.0
WithAddress sets the address in the queue client for Redis.
func WithCluster ¶ added in v0.11.0
WithCluster sets the clustering mode in the queue client for Redis.
func WithPrivateKey ¶ added in v0.21.0
WithPrivateKey sets the private key in the queue client for Redis.
func WithPublicKey ¶ added in v0.21.0
WithPublicKey sets the public key in the queue client for Redis.
func WithRoutes ¶ added in v0.24.0
WithRoutes sets the routes in the queue client for Redis.
func WithTimeout ¶ added in v0.11.0
WithTimeout sets the timeout in the queue client for Redis.