cel

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvaluatorService

type EvaluatorService interface {
	EvaluateCELRequest(request Request) (bool, error)
	Validate(request Request) (*cel.Ast, *cel.Env, error)
}

type EvaluatorServiceImpl

type EvaluatorServiceImpl struct {
	// contains filtered or unexported fields
}

func NewCELServiceImpl

func NewCELServiceImpl(logger *zap.SugaredLogger) *EvaluatorServiceImpl

func (*EvaluatorServiceImpl) EvaluateCELRequest

func (impl *EvaluatorServiceImpl) EvaluateCELRequest(request Request) (bool, error)

func (*EvaluatorServiceImpl) Validate

func (impl *EvaluatorServiceImpl) Validate(request Request) (*cel.Ast, *cel.Env, error)

type ExpressionMetadata

type ExpressionMetadata struct {
	Params []ExpressionParam
}

type ExpressionParam

type ExpressionParam struct {
	ParamName ParamName       `json:"paramName"`
	Value     interface{}     `json:"value"`
	Type      ParamValuesType `json:"type"`
}

type ParamName

type ParamName string
const AppName ParamName = "appName"
const CdPipelineName ParamName = "cdPipelineName"
const CdPipelineTriggerType ParamName = "cdPipelineTriggerType"
const ChartRefId ParamName = "chartRefId"
const ClusterName ParamName = "clusterName"
const ContainerImage ParamName = "containerImage"
const ContainerImageTag ParamName = "containerImageTag"
const ContainerRepo ParamName = "containerRepository"
const EnvName ParamName = "envName"
const ImageLabels ParamName = "imageLabels"
const IsProdEnv ParamName = "isProdEnv"
const ProjectName ParamName = "projectName"

type ParamValuesType

type ParamValuesType string
const (
	ParamTypeString         ParamValuesType = "string"
	ParamTypeObject         ParamValuesType = "object"
	ParamTypeInteger        ParamValuesType = "integer"
	ParamTypeList           ParamValuesType = "list"
	ParamTypeBool           ParamValuesType = "bool"
	ParamTypeMapStringToAny ParamValuesType = "mapStringToAny"
)

type Request

type Request struct {
	Expression         string             `json:"expression"`
	ExpressionMetadata ExpressionMetadata `json:"params"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL