grpcrand

package
v1.57.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package grpcrand implements math/rand functions in a concurrent-safe way with a global random source, independent of math/rand's global source.

Index

Constants

This section is empty.

Variables

View Source
var Shuffle = func(n int, f func(int, int)) {
	mu.Lock()
	defer mu.Unlock()
	r.Shuffle(n, f)
}

Shuffle implements rand.Shuffle on the grpcrand global source.

Functions

func ExpFloat64 added in v1.57.0

func ExpFloat64() float64

ExpFloat64 implements rand.ExpFloat64 on the grpcrand global source.

func Float64

func Float64() float64

Float64 implements rand.Float64 on the grpcrand global source.

func Int added in v1.39.0

func Int() int

Int implements rand.Int on the grpcrand global source.

func Int31n added in v1.50.0

func Int31n(n int32) int32

Int31n implements rand.Int31n on the grpcrand global source.

func Int63n

func Int63n(n int64) int64

Int63n implements rand.Int63n on the grpcrand global source.

func Intn

func Intn(n int) int

Intn implements rand.Intn on the grpcrand global source.

func Uint32 added in v1.56.0

func Uint32() uint32

Uint32 implements rand.Uint32 on the grpcrand global source.

func Uint64 added in v1.40.0

func Uint64() uint64

Uint64 implements rand.Uint64 on the grpcrand global source.

Types

This section is empty.

Jump to

Keyboard shortcuts

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