You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: traceerego.go
    path of file: ./repos/tracee/pkg/signatures/regosig
    
    the code of the file until where you have to start completion: package regosig

import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"regexp"
	"strings"

	"github.com/open-policy-agent/opa/ast"
	"github.com/open-policy-agent/opa/rego"

	"github.com/aquasecurity/tracee/types/detect"
	"github.com/aquasecurity/tracee/types/protocol"
)

// RegoSignature is an abstract signature that is implemented in rego
// each struct instance is associated with a rego file
// the rego file declares the following signatures:
// __rego_metadoc__: a *document* rule that defines the rule's met
    
func (sig *RegoSignature) OnEvent(event protocol.Event) error {
	input := rego.EvalInput(event.Payload)
	results, err := sig.matchPQ.Eval(context.TODO(), input)
	if err != nil {
		return fmt.Errorf("evaluating rego: %w", err)
	}

	if len(results) > 0 && len(results[0].Expressions) > 0 && results[0].Expressions[0].Value != nil {
		switch v := results[0].Expressions[0].Value.(type) {
		case bool:
			if v {
				sig.cb(&detect.Finding{
					Data:        nil,
					Event:       event,
					SigMetadata: sig.metadata,
				})
			}
		case map[string]interface{}:
			sig.cb(&detect.Finding{
				Data:        v,
				Event:       event,
				SigMetadata: sig.metadata,
			})
		}
	}
	return nil
}