Documentation ¶
Index ¶
- type CryptoSeed
- type Random
- func (r *Random) Bool() bool
- func (r *Random) ElementFromSlice(slice interface{}) interface{}
- func (r *Random) Float32() float32
- func (r *Random) Float64() float64
- func (r *Random) Int() int
- func (r *Random) IntBetween(min, max int) int
- func (r *Random) IntN(n int) int
- func (r *Random) KeyFromMap(anyMap interface{}) interface{}
- func (r *Random) String() string
- func (r *Random) StringN(length int) string
- func (r *Random) Time() time.Time
- func (r *Random) TimeBetween(from, to time.Time) time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptoSeed ¶
type CryptoSeed struct{}
func (CryptoSeed) Int63 ¶
func (c CryptoSeed) Int63() int64
Int63 returns a non-negative pseudo-random 63-bit integer as an int64.
func (CryptoSeed) Seed ¶
func (c CryptoSeed) Seed(seed int64)
Seed should use the provided seed value to initialize the generator to a deterministic state, but in CryptoSeed, the value is ignored.
func (CryptoSeed) Uint64 ¶
func (c CryptoSeed) Uint64() uint64
type Random ¶
A Random is a source of random numbers. It is safe to be used in from multiple goroutines.
func (*Random) ElementFromSlice ¶
func (r *Random) ElementFromSlice(slice interface{}) interface{}
func (*Random) IntBetween ¶
IntBetween returns, as an int, a non-negative pseudo-random number based on the received int range's [min,max].
func (*Random) IntN ¶
IntN returns, as an int, a non-negative pseudo-random number in [0,n). It panics if n <= 0.
func (*Random) KeyFromMap ¶
func (r *Random) KeyFromMap(anyMap interface{}) interface{}
Click to show internal directories.
Click to hide internal directories.