fuzz

package
v0.1.0-memsql Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fuzzer

type Fuzzer struct {
	// contains filtered or unexported fields
}

func New

func New(schema schema.ReferenceSchema) *Fuzzer

New returns a new Fuzzer.

func (*Fuzzer) EmptyChance

func (f *Fuzzer) EmptyChance(p float64) *Fuzzer

EmptyChance sets the probability of creating an empty field map to the given chance. The chance should be between 0 (no empty fields) and 1 (all empty), inclusive.

func (*Fuzzer) Fuzz

func (f *Fuzzer) Fuzz() map[string]interface{}

Fuzz recursively fills a Resource based on fields the ReferenceSchema of the Fuzzer.

func (*Fuzzer) NeverEmpty

func (f *Fuzzer) NeverEmpty(names ...string) *Fuzzer

NeverEmpty makes sure that all passed attribute names are never empty during fuzzing. Setting a complex attribute on never empty will also make their sub attributes never empty. i.e. "displayName", "name.givenName" or "emails.value"

func (*Fuzzer) NumElements

func (f *Fuzzer) NumElements(atLeast, atMost int) *Fuzzer

NumElements sets the minimum and maximum number of elements that will be added. If the elements are not required, it is possible to get less elements than the given parameter.

func (*Fuzzer) RandSource

func (f *Fuzzer) RandSource(s rand.Source) *Fuzzer

RandSource causes the Fuzzer to get values from the given source of randomness.

Jump to

Keyboard shortcuts

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