Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MillisecondNonce ¶
type MillisecondNonce struct {
// contains filtered or unexported fields
}
MillisecondNonce generates nonce values based on the current time in milliseconds with microsecond precision.
func NewMillisecondNonce ¶
func NewMillisecondNonce(now time.Time) *MillisecondNonce
func (*MillisecondNonce) GetInt64 ¶
func (ng *MillisecondNonce) GetInt64() int64
GetInt64 generates a unique nonce based on the current time in milliseconds * 1000. If multiple calls occur within the same millisecond, atomic increment ensures uniqueness. The unit is microsecond (1 second = 1,000,000 microseconds).
func (*MillisecondNonce) GetString ¶
func (ng *MillisecondNonce) GetString() string
GetString generates a unique nonce based on the current time in milliseconds * 1000. If multiple calls occur within the same millisecond, atomic increment ensures uniqueness.
type SecondNonce ¶
type SecondNonce struct {
// contains filtered or unexported fields
}
SecondNonce generates nonce values based on the current time in seconds with microsecond precision.
func NewSecondNonce ¶
func NewSecondNonce(now time.Time) *SecondNonce
func (*SecondNonce) GetInt64 ¶
func (ng *SecondNonce) GetInt64() int64
GetInt64 generates a unique nonce based on the current time in seconds * 1000. If multiple calls occur within the same second, atomic increment ensures uniqueness. The unit is millisecond (1 second = 1,000 milliseconds).
func (*SecondNonce) GetString ¶
func (ng *SecondNonce) GetString() string
GetString generates a unique nonce based on the current time in seconds * 1000.