|
|
@ -353,19 +353,19 @@ type TxnResponse struct { |
|
|
|
//
|
|
|
|
//
|
|
|
|
// Here's an example:
|
|
|
|
// Here's an example:
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// ops := KVTxnOps{
|
|
|
|
// ops := KVTxnOps{
|
|
|
|
// &KVTxnOp{
|
|
|
|
// &KVTxnOp{
|
|
|
|
// Verb: KVLock,
|
|
|
|
// Verb: KVLock,
|
|
|
|
// Key: "test/lock",
|
|
|
|
// Key: "test/lock",
|
|
|
|
// Session: "adf4238a-882b-9ddc-4a9d-5b6758e4159e",
|
|
|
|
// Session: "adf4238a-882b-9ddc-4a9d-5b6758e4159e",
|
|
|
|
// Value: []byte("hello"),
|
|
|
|
// Value: []byte("hello"),
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// &KVTxnOp{
|
|
|
|
// &KVTxnOp{
|
|
|
|
// Verb: KVGet,
|
|
|
|
// Verb: KVGet,
|
|
|
|
// Key: "another/key",
|
|
|
|
// Key: "another/key",
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// ok, response, _, err := kv.Txn(&ops, nil)
|
|
|
|
// ok, response, _, err := kv.Txn(&ops, nil)
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// If there is a problem making the transaction request then an error will be
|
|
|
|
// If there is a problem making the transaction request then an error will be
|
|
|
|
// returned. Otherwise, the ok value will be true if the transaction succeeded
|
|
|
|
// returned. Otherwise, the ok value will be true if the transaction succeeded
|
|
|
|