random

package
v0.2201.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package random provides a concurrency safe https://golang.org/pkg/math/rand/#Rand object.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomValueFromInterval added in v0.2200.2

func GetRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration

Returns a random value from the following interval:

[currentInterval - randomizationFactor * currentInterval, currentInterval + randomizationFactor * currentInterval].

func NewConcurrencySafeSource

func NewConcurrencySafeSource(seed int64) rand.Source

NewConcurrencySafeSource creates a concurrency safe source.

func NewRand

func NewRand(seed int64) *rand.Rand

NewRand is a convenience function to generate a new https://golang.org/pkg/math/rand/#Rand object that is concurrency safe.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL