Documentation
¶
Index ¶
- func Carry(c EndpointClient) contextx.Carrier
- func With(ctx context.Context, c EndpointClient) context.Context
- type Endpoint
- func (e *Endpoint) Client() redis.UniversalClient
- func (e *Endpoint) Close() error
- func (e *Endpoint) Exec(ctx context.Context, cmd string, args ...any) (any, error)
- func (e *Endpoint) Init(ctx context.Context) error
- func (e *Endpoint) Key(k string) string
- func (e *Endpoint) LivenessCheck(ctx context.Context) (d liveness.Result)
- type EndpointClient
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Carry ¶
func Carry(c EndpointClient) contextx.Carrier
Types ¶
type Endpoint ¶
func (*Endpoint) Client ¶
func (e *Endpoint) Client() redis.UniversalClient
type EndpointClient ¶
type EndpointClient interface {
Client() redis.UniversalClient
}
func Must ¶
func Must(ctx context.Context) EndpointClient
type Option ¶
type Option struct {
// Prefix
Prefix string
// Addresses cluster address
Addresses []string `url:"-"`
// DB single-node database to be selected once connected
DB int `url:""`
// ConnectionTimeout connection timeout
ConnectionTimeout types.Duration `url:",default=100ms"`
// OperationTimeout read/write timeout
OperationTimeout types.Duration `url:",default=100ms"`
// BufferSizeKB is the size of the bufio.Reader buffer for each connection.
// default: 128KiB
BufferSizeKB int `url:",default=128"`
// PoolSize controls redis request concurrency. 10*GOMAXPROCS is recommended.
// this option affects MaxActiveConns, which will be set to 4 times of PoolSize
// for balancing connection stability and concurrent performance.
PoolSize int `url:",default=20"`
MaxIdleConnection int `url:",default=10"`
MaxIdleTime types.Duration `url:",default=1h"`
// SentinelAuth auth info for sentinel if enabled
SentinelAuth types.Userinfo `url:"-"`
// MasterName is sentinel master name
MasterName string
ClusterMode bool
}
func (Option) ClientOption ¶
func (o Option) ClientOption() *redis.UniversalOptions
func (*Option) SetDefault ¶
func (o *Option) SetDefault()
Click to show internal directories.
Click to hide internal directories.