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

Method GetTime

pkg/event/param.go:631–641  ·  view source on GitHub ↗

GetTime returns the underlying time structure from the parameter.

(name string)

Source from the content-addressed store, hash-verified

629
630// GetTime returns the underlying time structure from the parameter.
631func (pars Params) GetTime(name string) (time.Time, error) {
632 par, err := pars.findParam(name)
633 if err != nil {
634 return time.Unix(0, 0), err
635 }
636 v, ok := par.Value.(time.Time)
637 if !ok {
638 return time.Unix(0, 0), fmt.Errorf("unable to type cast %q parameter to Time value", name)
639 }
640 return v, nil
641}
642
643// MustGetTime returns the underlying time structure from the parameter or panics
644// if any errors occur.

Callers 4

newProcStateMethod · 0.80
GetMethod · 0.80
GetMethod · 0.80
newEventDictFunction · 0.80

Calls 1

findParamMethod · 0.95

Tested by

no test coverage detected