cspslogtest

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RapidSpec

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

RapidSpec helps generate compact useful random events and event sets using the rapid property test framework.

func (*RapidSpec) RandomAttributeKey

func (spec *RapidSpec) RandomAttributeKey(except []string) *rapid.Generator[string]

RandomAttributeKey returns a random record attribute key name, with a bias towards returning a key that we have already generated.

func (*RapidSpec) RandomAttributeKeys

func (spec *RapidSpec) RandomAttributeKeys(count int, except []string) *rapid.Generator[[]string]

RandomAttributeKeys returns a slice of distinct random record attribute key names, with a bias towards returning a key that we have already generated.

func (*RapidSpec) RandomAttributeValue

func (spec *RapidSpec) RandomAttributeValue() *rapid.Generator[slog.Value]

RandomAttributeValue returns a random record attribute value.

func (*RapidSpec) RandomBoolValue

func (spec *RapidSpec) RandomBoolValue() *rapid.Generator[slog.Value]

func (*RapidSpec) RandomDurationValue

func (spec *RapidSpec) RandomDurationValue() *rapid.Generator[slog.Value]

func (*RapidSpec) RandomElement

func (spec *RapidSpec) RandomElement() *rapid.Generator[any]

func (*RapidSpec) RandomElementOf

func (spec *RapidSpec) RandomElementOf(set anf.Set) *rapid.Generator[any]

func (*RapidSpec) RandomFloatValue

func (spec *RapidSpec) RandomFloatValue() *rapid.Generator[slog.Value]

func (*RapidSpec) RandomIntValue

func (spec *RapidSpec) RandomIntValue() *rapid.Generator[slog.Value]

func (*RapidSpec) RandomRecord

func (spec *RapidSpec) RandomRecord(exceptKeys []string) *rapid.Generator[slog.Record]

RandomElement returns a random slog record.

func (*RapidSpec) RandomSet

func (spec *RapidSpec) RandomSet(min, max int) *rapid.Generator[anf.Set]

RandomSet returns a random [Set]. It might be empty, even if you choose a min > 0! (With an ANF set, we can't assume that a set with a non-empty set of clauses is empty.)

func (*RapidSpec) RandomStringValue

func (spec *RapidSpec) RandomStringValue() *rapid.Generator[slog.Value]

func (*RapidSpec) RandomTimeValue

func (spec *RapidSpec) RandomTimeValue() *rapid.Generator[slog.Value]

func (*RapidSpec) SingletonSet

func (spec *RapidSpec) SingletonSet(element any) anf.Set

Jump to

Keyboard shortcuts

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