MCPcopy Create free account
hub / github.com/dbProjectRED/redimo.go / First

Method First

streams.go:116–119  ·  view source on GitHub ↗

First returns the first valid XID at this timestamp. Useful for the start parameter of XRANGE or XREVRANGE.

()

Source from the content-addressed store, hash-verified

114
115// First returns the first valid XID at this timestamp. Useful for the start parameter of XRANGE or XREVRANGE.
116func (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,

Callers 1

TestXIDGenerationFunction · 0.80

Calls 2

TimeMethod · 0.95
XIDTypeAlias · 0.85

Tested by 1

TestXIDGenerationFunction · 0.64