MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / SetValue

Method SetValue

pkg/event/param.go:219–226  ·  view source on GitHub ↗

SetValue replaces the value for the given parameter name. It will return an error if the supplied parameter is not present in the parameter map.

(name string, value params.Value)

Source from the content-addressed store, hash-verified

217// SetValue replaces the value for the given parameter name. It will return an error
218// if the supplied parameter is not present in the parameter map.
219func (pars Params) SetValue(name string, value params.Value) error {
220 _, err := pars.findParam(name)
221 if err != nil {
222 return fmt.Errorf("setting the value on a missing %q parameter is not allowed", name)
223 }
224 pars[name].Value = value
225 return nil
226}
227
228// GetRaw returns the raw value for given parameter name. It is the responsibility of the caller to probe type assertion
229// on the value before yielding its underlying type.

Callers 4

TestParamsFunction · 0.95
GetMethod · 0.80
processEventMethod · 0.80
processEventMethod · 0.80

Calls 1

findParamMethod · 0.95

Tested by 1

TestParamsFunction · 0.76