rules

package
v0.0.0-...-99ac84a Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ConditionOperatorEqual = ConditionOperator("Equal")

ConditionOperatorEqual Equal.

View Source
const ConditionOperatorNotEqual = ConditionOperator("NotEqual")

ConditionOperatorNotEqual Not Equal.

View Source
const RuleActionAdd = ActionType("add")

RuleActionAdd Rule Action Add.

View Source
const RuleActionDelete = ActionType("delete")

RuleActionDelete Rule Action Delete.

Variables

View Source
var ErrCannotStringifyAvailableTagValues = errors.New("error cannot transform to string available tag values")

ErrCannotStringifyAvailableTagValues Cannot stringify available tag values.

View Source
var ErrRuleActionNotSupported = errors.New("rule action not supported")

ErrRuleActionNotSupported Rule action not supported.

View Source
var ErrRuleConditionOperatorNotSupported = errors.New("condition operator not supported")

ErrRuleConditionOperatorNotSupported Rule condition operator not supported.

View Source
var ErrRuleEmptyTag = errors.New("tag rule mustn't be empty")

ErrRuleEmptyTag Err Rule Empty Tag.

View Source
var ErrRuleEmptyWhenCondition = errors.New("when condition mustn't be empty")

ErrRuleEmptyWhenCondition Error when "when condition" is empty.

View Source
var ErrRuleQueryAndValueEmptyForAddCase = errors.New("query and value mustn't be empty for add case")

ErrRuleQueryAndValueEmptyForAddCase Err Rule Query and Value empty for Add case.

View Source
var ErrRuleQueryAndValuePopulatedForAddCase = errors.New("query and value cannot be populated at the same time in add case")

ErrRuleQueryAndValuePopulatedForAddCase Err Rule query and value populated for Add case.

Functions

func CalculateTags

func CalculateTags(actualTags []*tags.Tag, availableTagValues map[string]interface{}, rules []*Rule) (*tags.TagDelta, error)

CalculateTags Calculate tags delta to add/update or delete tags on resource.

Types

type ActionType

type ActionType string

ActionType Action type.

type Condition

type Condition struct {
	Condition string
	Value     string
	Operator  ConditionOperator
}

Condition condition.

type ConditionOperator

type ConditionOperator string

ConditionOperator Condition operator.

type Rule

type Rule struct {
	Tag    string
	Query  string
	Value  string
	Action ActionType
	When   []*Condition
}

Rule rule.

func New

func New(ruleConfigs []*config.RuleConfig) ([]*Rule, error)

New Create rules array from ruleConfig with validation.

Jump to

Keyboard shortcuts

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