|
|
@@ -69,6 +69,26 @@ type Op struct {
|
|
|
leaseID LeaseID
|
|
|
}
|
|
|
|
|
|
+// accesors / mutators
|
|
|
+
|
|
|
+// KeyBytes returns the byte slice holding the Op's key.
|
|
|
+func (op Op) KeyBytes() []byte { return op.key }
|
|
|
+
|
|
|
+// WithKeyBytes sets the byte slice for the Op's key.
|
|
|
+func (op *Op) WithKeyBytes(key []byte) { op.key = key }
|
|
|
+
|
|
|
+// RangeBytes returns the byte slice holding with the Op's range end, if any.
|
|
|
+func (op Op) RangeBytes() []byte { return op.end }
|
|
|
+
|
|
|
+// WithRangeBytes sets the byte slice for the Op's range end.
|
|
|
+func (op *Op) WithRangeBytes(end []byte) { op.end = end }
|
|
|
+
|
|
|
+// ValueBytes returns the byte slice holding the Op's value, if any.
|
|
|
+func (op Op) ValueBytes() []byte { return op.val }
|
|
|
+
|
|
|
+// WithValueBytes sets the byte slice for the Op's value.
|
|
|
+func (op *Op) WithValueBytes(v []byte) { op.val = v }
|
|
|
+
|
|
|
func (op Op) toRangeRequest() *pb.RangeRequest {
|
|
|
if op.t != tRange {
|
|
|
panic("op.t != tRange")
|