cockroach: Index | Files

package workloadimpl

import ""

Package workloadimpl provides dependency-light helpers for implementing workload.Generators.


Package Files

doc.go precomputedrand.go random.go

func PrecomputedRandInit Uses

func PrecomputedRandInit(rng rand.Source, length int, alphabet string) func() PrecomputedRand

PrecomputedRandInit returns a init function that lazily initializes and returns a PrecomputedRand. This initialization work is done once and the result is shared, subsequent calls to return this shared one. The init function is concurrency safe.

func RandStringFast Uses

func RandStringFast(rng rand.Source, buf []byte, alphabet string)

RandStringFast is a non-specialized random string generator with an even distribution of alphabet in the output.

type PrecomputedRand Uses

type PrecomputedRand []byte

PrecomputedRand is a precomputed sequence of random data in some alphabet.

func (PrecomputedRand) FillBytes Uses

func (pr PrecomputedRand) FillBytes(offset int, buf []byte) int

FillBytes fills the given buffer with precomputed random data, starting at the given offset (which is like a seed) and returning a new offset to be used on the next call. FillBytes is concurrency safe.

Package workloadimpl imports 3 packages (graph) and is imported by 4 packages. Updated 2019-07-10. Refresh now. Tools for package owners.