Documentation ¶
Index ¶
- func FlattenMultiError(mErr *multierror.Error) error
- func HasDeprecatedFields(rawJson []byte, deprecatedPaths []string) error
- func IsContextTriggered(ctx context.Context) bool
- func RecoverWithError(panicErr *error)
- func TrueCause(err error) error
- func WaitFor(ctx context.Context, duration time.Duration)
- type Buffer
- type DataPath
- func (path DataPath) Contains(val string) bool
- func (path DataPath) Lookup(data json.RawMessage) (json.RawMessage, error)
- func (path DataPath) LookupMulti(data json.RawMessage, separator string) ([]json.RawMessage, error)
- func (path DataPath) LookupNoQuotes(data json.RawMessage) (json.RawMessage, error)
- func (path *DataPath) String() string
- type DistributionSettings
- func (settings DistributionSettings) GetActionInfo() string
- func (settings DistributionSettings) GetMax() (float64, error)
- func (settings DistributionSettings) GetMin() (float64, error)
- func (settings DistributionSettings) RandDuration(rnd Randomizer) (time.Duration, error)
- func (settings DistributionSettings) Validate() error
- type DistributionType
- type NoDataFound
- type NoStepsError
- type Params
- type Randomizer
- type RowFile
- type TimeDuration
- type TreatAs
- type UniqueInts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlattenMultiError ¶
func FlattenMultiError(mErr *multierror.Error) error
FlattenMultiError return nil or original error if multierror does not have more than one error
func HasDeprecatedFields ¶ added in v0.6.8
HasDeprecatedFields check json if keys exist at provided paths, if any exist report error
func IsContextTriggered ¶
IsContextTriggered check if context is "done"
func RecoverWithError ¶
func RecoverWithError(panicErr *error)
RecoverWithError recovers from panic and sets error to panicErr
Types ¶
type Buffer ¶
func (*Buffer) String ¶
String returns the contents of the unread portion of the buffer as a string. If the Buffer is a nil pointer, it returns "<nil>".
func (*Buffer) WriteByte ¶
WriteByte appends the byte c to the buffer, growing the buffer as needed.
func (*Buffer) WriteBytes ¶
Write bytes to buffer, errors written to stderr
func (*Buffer) WriteRune ¶
WriteRune appends the UTF-8 encoding of Unicode code point r to the buffer, errors written to stderr
func (*Buffer) WriteString ¶
WriteString to buffer, errors written to stderr
type DataPath ¶ added in v0.6.8
type DataPath string
DataPath string which can be return as substring splitted on / (slash)
func (DataPath) Lookup ¶ added in v0.6.8
func (path DataPath) Lookup(data json.RawMessage) (json.RawMessage, error)
Lookup object in path, if data found is of type string it will be quoted with ""
func (DataPath) LookupMulti ¶ added in v0.6.8
func (path DataPath) LookupMulti(data json.RawMessage, separator string) ([]json.RawMessage, error)
LookupMulti objects with subpaths under an array in a path
func (DataPath) LookupNoQuotes ¶ added in v0.6.8
func (path DataPath) LookupNoQuotes(data json.RawMessage) (json.RawMessage, error)
Lookup object in path, data of type string will not be quoted
type DistributionSettings ¶
type DistributionSettings struct { // Type of timer delay Type DistributionType `json:"type" displayname:"Distribution type" doc-key:"thinktime.type"` // Delay static delay when using static timer delay Delay float64 `json:"delay,omitempty" displayname:"Static delay" doc-key:"thinktime.delay"` // Mean value Mean float64 `json:"mean,omitempty" displayname:"Mean value" doc-key:"thinktime.mean"` // Deviation value Deviation float64 `json:"dev,omitempty" displayname:"Deviation value" doc-key:"thinktime.dev"` }
DistributionSettings think time settings
func (DistributionSettings) GetActionInfo ¶
func (settings DistributionSettings) GetActionInfo() string
GetActionInfo get information for action details logging
func (DistributionSettings) GetMax ¶
func (settings DistributionSettings) GetMax() (float64, error)
GetMax value
func (DistributionSettings) GetMin ¶
func (settings DistributionSettings) GetMin() (float64, error)
GetMin value
func (DistributionSettings) RandDuration ¶ added in v0.4.11
func (settings DistributionSettings) RandDuration(rnd Randomizer) (time.Duration, error)
RandDuration returns a random duration
func (DistributionSettings) Validate ¶
func (settings DistributionSettings) Validate() error
Validate DistributionSettings
type DistributionType ¶
type DistributionType int
DistributionType type of distribution
const ( // StaticDistribution fixed distribution StaticDistribution DistributionType = iota // UniformDistribution uniform distribution, defined by "mean" and "dev" UniformDistribution )
func (DistributionType) GetEnumMap ¶
func (value DistributionType) GetEnumMap() *enummap.EnumMap
GetEnumMap of DistributionType
func (DistributionType) MarshalJSON ¶
func (value DistributionType) MarshalJSON() ([]byte, error)
MarshalJSON marshal ThinkTime type
func (*DistributionType) UnmarshalJSON ¶
func (value *DistributionType) UnmarshalJSON(arg []byte) error
UnmarshalJSON unmarshal DistributionType
type NoDataFound ¶ added in v0.6.8
type NoDataFound string
NoDataFound no data found in path
func (NoDataFound) Error ¶ added in v0.6.8
func (err NoDataFound) Error() string
Error no data found in data path
type NoStepsError ¶ added in v0.6.8
type NoStepsError string
NoStepsError no steps to take in data path
func (NoStepsError) Error ¶ added in v0.6.8
func (err NoStepsError) Error() string
Error no steps in data path
type Randomizer ¶ added in v0.4.11
type RowFile ¶
type RowFile struct {
// contains filtered or unexported fields
}
RowFile path to file on disc to read into memory
func NewRowFile ¶
NewRowFile reads rows from file path into memory
func (RowFile) MarshalJSON ¶
MarshalJSON marshal filepath to JSON
func (*RowFile) Rows ¶
Rows in memory from file, to read into memory, either ReadRows or UnmarshalJSON needs to have been called
func (*RowFile) UnmarshalJSON ¶
UnmarshalJSON reads file from filepath into memory
type TimeDuration ¶
func (TimeDuration) MarshalJSON ¶
func (duration TimeDuration) MarshalJSON() ([]byte, error)
MarshalJSON marshal time buffer duration to JSON
func (*TimeDuration) UnmarshalJSON ¶
func (duration *TimeDuration) UnmarshalJSON(arg []byte) error
UnmarshalJSON unmarshal time buffer duration from JSON
type TreatAs ¶
type TreatAs interface { /* Supported types: String Int Float Enum Bool Slice SliceElement StringMap StringMapElement */ TreatAs() string }
Implement this interface to override the type a struct is treated as by the GUI
type UniqueInts ¶ added in v0.5.3
type UniqueInts map[int]struct{}
func (*UniqueInts) AddValue ¶ added in v0.5.3
func (u *UniqueInts) AddValue(v int)
AddValue to unique list
func (*UniqueInts) Array ¶ added in v0.5.3
func (u *UniqueInts) Array() []int
Array of unique integers
func (*UniqueInts) HasValue ¶ added in v0.5.3
func (u *UniqueInts) HasValue(v int) bool
HasValue test if collection includes value