Documentation ¶
Index ¶
- Variables
- func MapTagFilterToNormalizedString(element restapi.TagFilterExpressionElement) (*string, error)
- func Normalize(input string) (string, error)
- type BracketExpression
- type ComparisonExpression
- type EntityOrigin
- type EntityOrigins
- type EntitySpec
- type ExpressionRenderer
- type FilterExpression
- type LogicalAndExpression
- type LogicalOrExpression
- type Mapper
- type Operator
- type Parser
- type PrimaryExpression
- type UnaryOperationExpression
Constants ¶
This section is empty.
Variables ¶
var ( //EntityOriginSource constant value for the EntityOrigin source EntityOriginSource = newEntityOrigin("src", restapi.TagFilterEntitySource) //EntityOriginDestination constant value for the EntityOrigin destination EntityOriginDestination = newEntityOrigin("dest", restapi.TagFilterEntityDestination) //EntityOriginNotApplicable constant value when no EntityOrigin is applicable EntityOriginNotApplicable = newEntityOrigin("na", restapi.TagFilterEntityNotApplicable) )
var SupportedEntityOrigins = EntityOrigins{EntityOriginSource, EntityOriginDestination, EntityOriginNotApplicable}
SupportedEntityOrigins slice of supported EntityOrigins
Functions ¶
func MapTagFilterToNormalizedString ¶ added in v1.5.3
func MapTagFilterToNormalizedString(element restapi.TagFilterExpressionElement) (*string, error)
MapTagFilterToNormalizedString maps a TagFilterExpressionElement to its normalized string. Returns nil in case an empty expression is provided and an error in case of any error occurred during mapping.
Types ¶
type BracketExpression ¶ added in v1.5.1
type BracketExpression struct { Bracket *LogicalOrExpression `parser:"\"(\" @@ \")\""` Primary *PrimaryExpression `parser:"| @@"` }
BracketExpression representation of a bracket expression
func (*BracketExpression) Render ¶ added in v1.5.1
func (e *BracketExpression) Render() string
Render implementation of ExpressionRenderer.Render
type ComparisonExpression ¶
type ComparisonExpression struct { Entity *EntitySpec `parser:"@@"` Operator Operator `` /* 237-byte string literal not displayed */ NumberValue *int64 `parser:"( @Number"` BooleanValue *bool `parser:"| @( \"FALSE\" | \"TRUE\" )"` StringValue *string `parser:"| @String )"` }
ComparisonExpression representation of a comparison expression.
func (*ComparisonExpression) Render ¶
func (e *ComparisonExpression) Render() string
Render implementation of ExpressionRenderer.Render
type EntityOrigin ¶
type EntityOrigin interface { //Key returns the key of the entity origin Key() string //TagFilterEntity returns the Instana API Ta Filter Entity TagFilterEntity() restapi.TagFilterEntity }
EntityOrigin custom type for the origin (source or destination) of a entity spec
type EntityOrigins ¶
type EntityOrigins []EntityOrigin
EntityOrigins custom type for a slice of entity origins
func (EntityOrigins) ForInstanaAPIEntity ¶
func (origins EntityOrigins) ForInstanaAPIEntity(input restapi.TagFilterEntity) EntityOrigin
ForInstanaAPIEntity returns the EntityOrigin for its corresponding TagFilterEntity from the Instana API
func (EntityOrigins) ForKey ¶
func (origins EntityOrigins) ForKey(input string) EntityOrigin
ForKey returns the EntityOrigin for its string representation
type EntitySpec ¶
type EntitySpec struct { Identifier string `parser:"@Ident"` TagKey *string `parser:"( \":\" @Ident )?"` Origin *string `parser:"( \"@\" @EntityOrigin )?"` }
EntitySpec custom type for an entity path specification Ident (@TagKeySeparator @Ident)? (@EntityOriginOperator @EntityOrigin)? "
func (*EntitySpec) Render ¶
func (o *EntitySpec) Render() string
Render implementation of the ExpressionRenderer interface
type ExpressionRenderer ¶
type ExpressionRenderer interface {
Render() string
}
ExpressionRenderer interface definition to render an expression in its normalized form
type FilterExpression ¶
type FilterExpression struct {
Expression *LogicalOrExpression `parser:"@@"`
}
FilterExpression representation of a tag filter expression
func (*FilterExpression) Render ¶
func (e *FilterExpression) Render() string
Render implementation of ExpressionRenderer.Render
type LogicalAndExpression ¶
type LogicalAndExpression struct { Left *BracketExpression `parser:" @@"` Operator *Operator `parser:"( @\"AND\""` Right *LogicalAndExpression `parser:" @@ )?"` }
LogicalAndExpression representation of a logical AND, or as a wrapper for a PrimaryExpression. 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 Mapper ¶
type Mapper interface { FromAPIModel(input restapi.TagFilterExpressionElement) (*FilterExpression, error) ToAPIModel(input *FilterExpression) restapi.TagFilterExpressionElement }
Mapper interface of the tag filter expression mapper
type Parser ¶
type Parser interface {
Parse(expression string) (*FilterExpression, error)
}
Parser interface for working with tag filter expressions of instana
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:"@@"` Operator Operator `parser:"@( \"IS_EMPTY\" | \"IS_BLANK\" | \"NOT_EMPTY\" | \"NOT_BLANK\" )"` }
UnaryOperationExpression representation of a unary expression
func (*UnaryOperationExpression) Render ¶
func (e *UnaryOperationExpression) Render() string
Render implementation of ExpressionRenderer.Render