github.com/DataDog/datadog-agent/pkg/security/secl@v0.55.0-devel.0.20240517055856-10c4965fea94/compiler/eval/model.go (about)

     1  // Unless explicitly stated otherwise all files in this repository are licensed
     2  // under the Apache License Version 2.0.
     3  // This product includes software developed at Datadog (https://www.datadoghq.com/).
     4  // Copyright 2016-present Datadog, Inc.
     5  
     6  package eval
     7  
     8  // Model - interface that a model has to implement for the rule compilation
     9  type Model interface {
    10  	// GetEvaluator returns an evaluator for the given field
    11  	GetEvaluator(field Field, regID RegisterID) (Evaluator, error)
    12  	// ValidateField returns whether the value use against the field is valid, ex: for constant
    13  	ValidateField(field Field, value FieldValue) error
    14  	// GetIterator return an iterator
    15  	GetIterator(field Field) (Iterator, error)
    16  	// NewEvent returns a new event instance
    17  	NewEvent() Event
    18  }