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

Function NewXID

streams.go:38–43  ·  view source on GitHub ↗

NewXID creates an XID with the given timestamp and sequence number.

(ts time.Time, seq uint64)

Source from the content-addressed store, hash-verified

36
37// NewXID creates an XID with the given timestamp and sequence number.
38func NewXID(ts time.Time, seq uint64) XID {
39 timePart := fmt.Sprintf("%020d", ts.Unix())
40 sequencePart := fmt.Sprintf("%020d", seq)
41
42 return XID(strings.Join([]string{timePart, sequencePart}, "-"))
43}
44
45// NewTimeXID creates an XID with the given timestamp. To get the first or the last
46// XID in this timestamp, use the First() or the Last() methods. This is especially

Callers 5

NewTimeXIDFunction · 0.85
NextMethod · 0.85
PrevMethod · 0.85
XADDMethod · 0.85
TestStreamDeletesFunction · 0.85

Calls 1

XIDTypeAlias · 0.85

Tested by 1

TestStreamDeletesFunction · 0.68