mox/mox-/cid.go
Mechiel Lukkien cb229cb6cf
mox!
2023-01-30 14:27:06 +01:00

17 lines
239 B
Go

package mox
import (
"sync/atomic"
"time"
)
var cid atomic.Int64
func init() {
cid.Store(time.Now().UnixMilli())
}
// Cid returns a new unique id to be used for connections/sessions/requests.
func Cid() int64 {
return cid.Add(1)
}