MCPcopy Create free account

hub / github.com/rs/xid / functions

Functions58 in github.com/rs/xid

↓ 7 callersMethodCompare
Compare returns an integer comparing two IDs. It behaves just like `bytes.Compare`. The result will be 0 if two IDs are identical, -1 if current id is
id.go:343
↓ 5 callersFunctionNew
New generates a globally unique ID
id.go:145
↓ 4 callersMethodIsNil
IsNil Returns true if this is a "nil" ID
id.go:316
↓ 3 callersFunctionFromString
FromString reads an ID from its string representation
id.go:170
↓ 3 callersMethodScan
Scan implements the sql.Scanner interface.
id.go:301
↓ 3 callersMethodUnmarshalText
UnmarshalText implements encoding/text TextUnmarshaler interface
id.go:224
↓ 2 callersMethodCounter
Counter returns the incrementing value part of the id. It's a runtime error to call this method with an invalid id.
id.go:285
↓ 2 callersFunctionFromBytes
FromBytes convert the byte array representation of `ID` back to `ID`
id.go:331
↓ 2 callersMethodMachine
Machine returns the 3-byte machine id part of the id. It's a runtime error to call this method with an invalid id.
id.go:273
↓ 2 callersMethodMarshalText
MarshalText implements encoding/text TextMarshaler interface
id.go:184
↓ 2 callersFunctionNilID
NilID returns a zero value for `xid.ID`.
id.go:321
↓ 2 callersMethodPid
Pid returns the process id part of the id. It's a runtime error to call this method with an invalid id.
id.go:279
↓ 2 callersMethodString
String returns a base32 hex lowercased with no padding representation of the id (char set is 0-9, a-v).
id.go:177
↓ 2 callersMethodTime
Time returns the timestamp part of the id. It's a runtime error to call this method with an invalid id.
id.go:265
↓ 2 callersFunctionencode
encode by unrolling the stdlib base32 algorithm + removing all safe checks
id.go:200
↓ 1 callersMethodBytes
Bytes returns the byte array representation of `ID`
id.go:326
↓ 1 callersMethodLen
()
id.go:349
↓ 1 callersMethodLess
(i, j int)
id.go:353
↓ 1 callersFunctionNewWithTime
NewWithTime generates a globally unique ID with the passed in time
id.go:150
↓ 1 callersFunctionSort
Sort sorts an array of IDs inplace. It works by wrapping `[]ID` and use `sort.Sort`.
id.go:363
↓ 1 callersMethodSwap
(i, j int)
id.go:357
↓ 1 callersMethodValue
Value implements the driver.Valuer interface.
id.go:292
↓ 1 callersFunctiondecode
decode by unrolling the stdlib base32 algorithm + removing all safe checks
id.go:248
↓ 1 callersFunctionrandInt
randInt generates a random uint32
id.go:136
↓ 1 callersFunctionreadMachineID
readMachineId generates machine id and puts it into the machineId global variable. If this function fails to get the hostname, it will cause a runtime
id.go:116
↓ 1 callersFunctionreadPlatformMachineID
()
hostid_linux.go:7
FunctionBenchmarkFromString
(b *testing.B)
id_test.go:235
FunctionBenchmarkNew
(b *testing.B)
id_test.go:219
FunctionBenchmarkNewString
(b *testing.B)
id_test.go:227
MethodMarshalJSON
MarshalJSON implements encoding/json Marshaler interface
id.go:191
FunctionTestFromBytes_InvalidBytes
(t *testing.T)
id_test.go:310
FunctionTestFromBytes_Invariant
(t *testing.T)
id_test.go:299
FunctionTestFromString
(t *testing.T)
id_test.go:108
FunctionTestFromStringInvalid
(t *testing.T)
id_test.go:119
FunctionTestIDDriverScan
(t *testing.T)
id_test.go:184
FunctionTestIDDriverScanByteFromDatabase
(t *testing.T)
id_test.go:206
FunctionTestIDDriverScanError
(t *testing.T)
id_test.go:196
FunctionTestIDDriverValue
(t *testing.T)
id_test.go:173
FunctionTestIDJSONMarshaling
(t *testing.T)
id_test.go:131
FunctionTestIDJSONUnmarshaling
(t *testing.T)
id_test.go:143
FunctionTestIDJSONUnmarshalingError
(t *testing.T)
id_test.go:157
FunctionTestIDPartsExtraction
(t *testing.T)
id_test.go:45
FunctionTestIDString
(t *testing.T)
id_test.go:101
FunctionTestID_Compare
(t *testing.T)
id_test.go:328
FunctionTestID_IsNil
func BenchmarkUUIDv1(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { _ = uuid.NewV1().String() } }) } func BenchmarkUUID
id_test.go:259
FunctionTestNew
(t *testing.T)
id_test.go:64
FunctionTestNilID
(t *testing.T)
id_test.go:286
FunctionTestNilID_IsNil
(t *testing.T)
id_test.go:293
FunctionTestSort
(t *testing.T)
id_test.go:389
FunctionTestSorter_Len
(t *testing.T)
id_test.go:350
FunctionTestSorter_Less
(t *testing.T)
id_test.go:359
FunctionTestSorter_Swap
(t *testing.T)
id_test.go:372
MethodUnmarshalJSON
UnmarshalJSON implements encoding/json Unmarshaler interface
id.go:238
Functioninit
()
id.go:96
FunctionreadPlatformMachineID
()
hostid_windows.go:11
FunctionreadPlatformMachineID
()
hostid_freebsd.go:7
FunctionreadPlatformMachineID
()
hostid_fallback.go:7
FunctionreadPlatformMachineID
()
hostid_darwin.go:7