Documentation ¶
Index ¶
Constants ¶
View Source
const HeaderName = "Correlation-Id"
Variables ¶
View Source
var DefaultIdGenerator = NewRandomIdGenerator( rand.New( NewLockedSource( rand.NewSource( time.Now().UTC().UnixNano(), ), ), ), )
Functions ¶
This section is empty.
Types ¶
type LockedSource ¶
type LockedSource struct {
// contains filtered or unexported fields
}
LockedSource is a copy of private go lockedSource https://github.com/golang/go/blob/master/src/math/rand/rand.go#L374
func NewLockedSource ¶
func NewLockedSource(src rand.Source) *LockedSource
func (*LockedSource) Int63 ¶
func (r *LockedSource) Int63() (n int64)
func (*LockedSource) Seed ¶
func (r *LockedSource) Seed(seed int64)
func (*LockedSource) Uint64 ¶
func (r *LockedSource) Uint64() (n uint64)
type RandomIdGenerator ¶
type RandomIdGenerator struct {
// contains filtered or unexported fields
}
func NewRandomIdGenerator ¶
func NewRandomIdGenerator(rand *rand.Rand) *RandomIdGenerator
func (*RandomIdGenerator) Generate ¶
func (rg *RandomIdGenerator) Generate(length int) string
Click to show internal directories.
Click to hide internal directories.