Documentation ¶
Index ¶
- Constants
- func DIMiddleware(client *Client) mux.MiddlewareFunc
- func UnaryDIInterceptor(client *Client) grpc.UnaryServerInterceptor
- type Client
- func (c *Client) Close() error
- func (c *Client) Del(ctx context.Context, ns, key string) error
- func (c *Client) Exists(ctx context.Context, ns, key string) error
- func (c *Client) Expire(ctx context.Context, ns, key string, exp time.Duration) error
- func (c *Client) Get(ctx context.Context, ns, key string, value any) error
- func (c *Client) Limit(ctx context.Context, ns, key string, limit redis_rate.Limit) (*redis_rate.Result, error)
- func (c *Client) LimitReport(ctx context.Context, ns, key string, limit redis_rate.Limit) (*redis_rate.Result, error)
- func (c *Client) NewMutex(ns, key string, exp time.Duration) *redsync.Mutex
- func (c *Client) OpenQueue(name string) (*Queue, error)
- func (c *Client) Set(ctx context.Context, ns, key string, value any, exp time.Duration) error
- type Configs
- type Consumer
- type Delivery
- type Queue
Constants ¶
View Source
const (
Name = "Redis"
)
Variables ¶
This section is empty.
Functions ¶
func DIMiddleware ¶
func DIMiddleware(client *Client) mux.MiddlewareFunc
func UnaryDIInterceptor ¶
func UnaryDIInterceptor(client *Client) grpc.UnaryServerInterceptor
Types ¶
type Client ¶
type Client struct { Configs DB *redis.Client Queue rmq.Connection Lock *redsync.Redsync Limiter *redis_rate.Limiter // contains filtered or unexported fields }
func (*Client) LimitReport ¶
type Configs ¶
type Configs struct { RedisAddress string `env:"REDIS_ADDRESS,required"` RedisPassword string `env:"REDIS_PASSWORD"` RedisDatabase int `env:"REDIS_DATABASE"` RedisQueueCleaning time.Duration `env:"REDIS_QUEUE_CLEANING" envDefault:"1m"` RedisQueuePool int64 `env:"REDIS_QUEUE_POOL" envDefault:"10"` RedisQueueApp string `env:"REDIS_QUEUE_APP" envDefault:"app"` }
Click to show internal directories.
Click to hide internal directories.