filterexpression

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//EntityOriginSource constant value for the source EntityOrigin
	EntityOriginSource = newEntityOrigin("src", restapi.MatcherExpressionEntitySource)
	//EntityOriginDestination constant value for the destination EntityOrigin
	EntityOriginDestination = newEntityOrigin("dest", restapi.MatcherExpressionEntityDestination)
	//EntityOriginNotApplicable constant value for the not applicable EntityOrigin
	EntityOriginNotApplicable = newEntityOrigin("na", restapi.MatcherExpressionEntityNotApplicable)
)

SupportedEntityOrigins slice of supported EntityOrigins

Functions

func Normalize added in v1.0.0

func Normalize(input string) (string, error)

Normalize parses the input and returns the normalized representation of the input string

Types

type ComparisonExpression added in v1.1.0

type ComparisonExpression struct {
	Entity   *EntitySpec `parser:"@Ident (@EntityOriginOperator @EntityOrigin)? "`
	Operator Operator    `` /* 237-byte string literal not displayed */
	Value    string      `parser:"@String"`
}

ComparisonExpression representation of a comparison expression.

func (*ComparisonExpression) Render added in v1.1.0

func (e *ComparisonExpression) Render() string

Render implementation of ExpressionRenderer.Render

type EntityOrigin added in v0.10.0

type EntityOrigin interface {
	//Key returns the key of the entity origin
	Key() string
	//MatcherExpressionEntity returns the Instana API Matcher Expression Entity
	MatcherExpressionEntity() restapi.MatcherExpressionEntity
}

EntityOrigin custom type for the origin (source or destination) of a entity spec

type EntityOrigins added in v0.10.0

type EntityOrigins []EntityOrigin

EntityOrigins custom type for a slice of entity origins

func (EntityOrigins) ForInstanaAPIEntity added in v0.10.0

func (origins EntityOrigins) ForInstanaAPIEntity(input restapi.MatcherExpressionEntity) EntityOrigin

ForInstanaAPIEntity returns the EntityOrigin for its cooresponding MatchExpressionEntity from the Instana API

func (EntityOrigins) ForKey added in v0.10.0

func (origins EntityOrigins) ForKey(input string) EntityOrigin

ForKey returns the EntityOrigin for its string representation

type EntitySpec added in v0.10.0

type EntitySpec struct {
	Identifier    string
	Origin        EntityOrigin
	OriginDefined bool
}

EntitySpec custom type for any kind of entity path specification

func (*EntitySpec) Capture added in v0.10.0

func (o *EntitySpec) Capture(values []string) error

Capture captures the string representation of an entity path from the given string. Interface of participle

func (*EntitySpec) Render added in v0.10.0

func (o *EntitySpec) Render() string

Render implementation of the ExpressionRenderer interface of EntitySpec

type ExpressionRenderer

type ExpressionRenderer interface {
	Render() string
}

ExpressionRenderer interface definition for all types of the Filter expression to render the corresponding value

type FilterExpression

type FilterExpression struct {
	Expression *LogicalOrExpression `parser:"@@"`
}

FilterExpression representation of a dynamic focus filter expression

func (*FilterExpression) Render

func (e *FilterExpression) Render() string

Render implementation of ExpressionRenderer.Render

type LogicalAndExpression

type LogicalAndExpression struct {
	Left     *PrimaryExpression    `parser:"  @@"`
	Operator *Operator             `parser:"( @\"AND\""`
	Right    *LogicalAndExpression `parser:"  @@ )?"`
}

LogicalAndExpression representation of a logical AND or as a wrapper for a PrimaryExpression only. The wrapping is required to handle precedence.

func (*LogicalAndExpression) Render

func (e *LogicalAndExpression) Render() string

Render implementation of ExpressionRenderer.Render

type LogicalOrExpression

type LogicalOrExpression struct {
	Left     *LogicalAndExpression `parser:"  @@"`
	Operator *Operator             `parser:"( @\"OR\""`
	Right    *LogicalOrExpression  `parser:"  @@ )?"`
}

LogicalOrExpression representation of a logical OR or as a wrapper for a, LogicalAndExpression or a PrimaryExpression. The wrapping is required to handle precedence.

func (*LogicalOrExpression) Render

func (e *LogicalOrExpression) Render() string

Render implementation of ExpressionRenderer.Render

type MatchExpressionMapper added in v1.1.0

type MatchExpressionMapper interface {
	FromAPIModel(input restapi.MatchExpression) (*FilterExpression, error)
	ToAPIModel(input *FilterExpression) restapi.MatchExpression
}

MatchExpressionMapper interface of the match expression mapper

func NewMatchExpressionMapper added in v1.1.0

func NewMatchExpressionMapper() MatchExpressionMapper

NewMatchExpressionMapper creates a new instance of the MatchExpressionMapper

type Operator

type Operator string

Operator custom type for any kind of operator

func (*Operator) Capture

func (o *Operator) Capture(values []string) error

Capture captures the string representation of an operator from the given string. Interface of participle

type Parser

type Parser interface {
	Parse(expression string) (*FilterExpression, error)
}

Parser interface for working with Dynamic Focus filters of instana

func NewParser

func NewParser() Parser

NewParser creates a new instance of a Parser

type PrimaryExpression

type PrimaryExpression struct {
	Comparison     *ComparisonExpression     `parser:"  @@"`
	UnaryOperation *UnaryOperationExpression `parser:"| @@"`
}

PrimaryExpression wrapper for either a comparison or a unary expression

func (*PrimaryExpression) Render

func (e *PrimaryExpression) Render() string

Render implementation of ExpressionRenderer.Render

type UnaryOperationExpression

type UnaryOperationExpression struct {
	Entity   *EntitySpec `parser:"@Ident (@EntityOriginOperator @EntityOrigin)? "`
	Operator Operator    `parser:"@( \"IS_EMPTY\" | \"IS_BLANK\"  | \"NOT_EMPTY\" | \"NOT_BLANK\" )"`
}

UnaryOperationExpression representation of a unary expression representing a unary operator

func (*UnaryOperationExpression) Render

func (e *UnaryOperationExpression) Render() string

Render implementation of ExpressionRenderer.Render

Jump to

Keyboard shortcuts

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