random

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Number

func Number(min int64, max int64) int64

Types

type Sampler

type Sampler[T any] struct {
	Values []T
	// contains filtered or unexported fields
}

func NewSampler

func NewSampler[T any](values []T) *Sampler[T]

func (*Sampler[T]) Get

func (s *Sampler[T]) Get(n int) []T

Get returns n 'random' items because the values gets preshuffled in a ring buffer there is no guaranty that there are no duplicate items

Jump to

Keyboard shortcuts

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