random

package
v0.2202.12 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 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

GetRandomValueFromInterval 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