mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
chore: cleanup names
This commit is contained in:
12
tx.go
12
tx.go
@ -19,7 +19,7 @@ type Tx struct {
|
||||
baseClient
|
||||
cmdable
|
||||
statefulCmdable
|
||||
hooks
|
||||
hooksMixin
|
||||
}
|
||||
|
||||
func (c *Client) newTx() *Tx {
|
||||
@ -28,7 +28,7 @@ func (c *Client) newTx() *Tx {
|
||||
opt: c.opt,
|
||||
connPool: pool.NewStickyConnPool(c.connPool),
|
||||
},
|
||||
hooks: c.hooks.clone(),
|
||||
hooksMixin: c.hooksMixin.clone(),
|
||||
}
|
||||
tx.init()
|
||||
return &tx
|
||||
@ -38,7 +38,7 @@ func (c *Tx) init() {
|
||||
c.cmdable = c.Process
|
||||
c.statefulCmdable = c.Process
|
||||
|
||||
c.hooks.setDefaultHook(defaultHook{
|
||||
c.initHooks(hooks{
|
||||
dial: c.baseClient.dial,
|
||||
process: c.baseClient.process,
|
||||
pipeline: c.baseClient.processPipeline,
|
||||
@ -47,7 +47,7 @@ func (c *Tx) init() {
|
||||
}
|
||||
|
||||
func (c *Tx) Process(ctx context.Context, cmd Cmder) error {
|
||||
err := c.hooks.process(ctx, cmd)
|
||||
err := c.processHook(ctx, cmd)
|
||||
cmd.SetErr(err)
|
||||
return err
|
||||
}
|
||||
@ -102,7 +102,7 @@ func (c *Tx) Unwatch(ctx context.Context, keys ...string) *StatusCmd {
|
||||
func (c *Tx) Pipeline() Pipeliner {
|
||||
pipe := Pipeline{
|
||||
exec: func(ctx context.Context, cmds []Cmder) error {
|
||||
return c.hooks.processPipeline(ctx, cmds)
|
||||
return c.processPipelineHook(ctx, cmds)
|
||||
},
|
||||
}
|
||||
pipe.init()
|
||||
@ -132,7 +132,7 @@ func (c *Tx) TxPipeline() Pipeliner {
|
||||
pipe := Pipeline{
|
||||
exec: func(ctx context.Context, cmds []Cmder) error {
|
||||
cmds = wrapMultiExec(ctx, cmds)
|
||||
return c.hooks.processTxPipeline(ctx, cmds)
|
||||
return c.processTxPipelineHook(ctx, cmds)
|
||||
},
|
||||
}
|
||||
pipe.init()
|
||||
|
Reference in New Issue
Block a user