First returns the first valid XID at this timestamp. Useful for the start parameter of XRANGE or XREVRANGE.
()
| 114 | |
| 115 | // First returns the first valid XID at this timestamp. Useful for the start parameter of XRANGE or XREVRANGE. |
| 116 | func (xid XID) First() XID { |
| 117 | timePart := fmt.Sprintf("%020d", xid.Time().Unix()) |
| 118 | return XID(strings.Join([]string{timePart, "00000000000000000000"}, "-")) |
| 119 | } |
| 120 | |
| 121 | // Last returns the last valid XID at this timestamp. Useful for the end parameter of XRANGE or XREVRANGE. |
| 122 | // Note that if the XID used as an end in the range simply based on the timestamp, the sequence number will be zero, |