TxnCall calls a command with transaction, it is used with multi/exec
(ctx *Context, txn *db.Transaction)
| 162 | |
| 163 | // TxnCall calls a command with transaction, it is used with multi/exec |
| 164 | func TxnCall(ctx *Context, txn *db.Transaction) (OnCommit, error) { |
| 165 | name := strings.ToLower(ctx.Name) |
| 166 | cmd, ok := txnCommands[name] |
| 167 | if !ok { |
| 168 | return nil, ErrUnKnownCommand(ctx.Name) |
| 169 | } |
| 170 | feedMonitors(ctx) |
| 171 | return cmd(ctx, txn) |
| 172 | } |
| 173 | |
| 174 | // AutoCommit commits to database after run a txn command |
| 175 | func AutoCommit(cmd TxnCommand) Command { |
no test coverage detected