Documentation ¶
Index ¶
- type RapidSpec
- func (spec *RapidSpec) RandomAttributeKey(except []string) *rapid.Generator[string]
- func (spec *RapidSpec) RandomAttributeKeys(count int, except []string) *rapid.Generator[[]string]
- func (spec *RapidSpec) RandomAttributeValue() *rapid.Generator[slog.Value]
- func (spec *RapidSpec) RandomBoolValue() *rapid.Generator[slog.Value]
- func (spec *RapidSpec) RandomDurationValue() *rapid.Generator[slog.Value]
- func (spec *RapidSpec) RandomElement() *rapid.Generator[any]
- func (spec *RapidSpec) RandomElementOf(set anf.Set) *rapid.Generator[any]
- func (spec *RapidSpec) RandomFloatValue() *rapid.Generator[slog.Value]
- func (spec *RapidSpec) RandomIntValue() *rapid.Generator[slog.Value]
- func (spec *RapidSpec) RandomRecord(exceptKeys []string) *rapid.Generator[slog.Record]
- func (spec *RapidSpec) RandomSet(min, max int) *rapid.Generator[anf.Set]
- func (spec *RapidSpec) RandomStringValue() *rapid.Generator[slog.Value]
- func (spec *RapidSpec) RandomTimeValue() *rapid.Generator[slog.Value]
- func (spec *RapidSpec) SingletonSet(element any) anf.Set
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 ¶
RandomAttributeKey returns a random record attribute key name, with a bias towards returning a key that we have already generated.
func (*RapidSpec) RandomAttributeKeys ¶
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 ¶
RandomAttributeValue returns a random record attribute value.
func (*RapidSpec) RandomBoolValue ¶
func (*RapidSpec) RandomDurationValue ¶
func (*RapidSpec) RandomElementOf ¶
func (*RapidSpec) RandomFloatValue ¶
func (*RapidSpec) RandomIntValue ¶
func (*RapidSpec) RandomRecord ¶
RandomElement returns a random slog record.
func (*RapidSpec) RandomSet ¶
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.)