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

Method checkBoundRefs

pkg/filter/filter.go:570–592  ·  view source on GitHub ↗

checkBoundRefs checks if the bound field is referencing a valid alias. If no valid alias is reference, this method returns an error specifying an incorrect alias reference.

()

Source from the content-addressed store, hash-verified

568// If no valid alias is reference, this method returns an error specifying
569// an incorrect alias reference.
570func (f *filter) checkBoundRefs() error {
571 if f.seq == nil {
572 return nil
573 }
574
575 aliases := make(map[string]bool)
576 for _, expr := range f.seq.Expressions {
577 if expr.Alias == "" {
578 continue
579 }
580 aliases[expr.Alias] = true
581 }
582
583 for _, field := range f.boundFields {
584 if _, ok := aliases[field.BoundVar.Value]; !ok {
585 return fmt.Errorf("%s bound field references "+
586 "an invalid '$%s' event alias",
587 field.String(), field.BoundVar.Value)
588 }
589 }
590
591 return nil
592}
593
594func makeSequenceLinkID(valuer ql.MapValuer, link *ql.SequenceLink) any {
595 if !link.IsCompound() {

Callers 1

CompileMethod · 0.95

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected