Documentation ¶
Overview ¶
Package rand provides utilities for creating and working with random value generators.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Reader io.Reader
Reader provides a random reader that can reset during testing.
Functions ¶
func CryptoRandInt63n ¶
CryptoRandInt63n returns a random int64 between zero and value of max obtained from the crypto rand source.
Types ¶
type UUID ¶
type UUID struct {
// contains filtered or unexported fields
}
UUID provides computing random UUID version 4 values from a random source reader.
func NewUUID ¶
NewUUID returns an initialized UUID value that can be used to retrieve random UUID version 4 values.
type UUIDIdempotencyToken ¶
type UUIDIdempotencyToken struct {
// contains filtered or unexported fields
}
UUIDIdempotencyToken provides a utility to get idempotency tokens in the UUID format.
func NewUUIDIdempotencyToken ¶
func NewUUIDIdempotencyToken(r io.Reader) *UUIDIdempotencyToken
NewUUIDIdempotencyToken returns a idempotency token provider returning tokens in the UUID random format using the reader provided.
func (UUIDIdempotencyToken) GetIdempotencyToken ¶
func (u UUIDIdempotencyToken) GetIdempotencyToken() (string, error)
GetIdempotencyToken returns a random UUID value for Idempotency token.