rules

package
v0.0.0-...-63a68a9 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionItem

type ActionItem map[string]string

ActionItem represnts a single action

func (ActionItem) GetType

func (p ActionItem) GetType() string

GetType retrurn the type of the action

type ConditionItem

type ConditionItem map[string]string

ConditionItem represnts one condition

func (ConditionItem) GetType

func (p ConditionItem) GetType() string

GetType retrurn the type of the condition

type Rule

type Rule struct {
	Name       string          `json:"name,omitempty"`
	Conditions []ConditionItem `json:"conditions"`
	Actions    []ActionItem    `json:"actions"`
}

Rule represnts single rule

type TagRules

type TagRules struct {
	DryRun *bool  `json:"dryrun,omitempty"`
	Rules  []Rule `json:"rules"`
}

TagRules represents rules parsed from a rules definition

func NewFromFile

func NewFromFile(filename string) (TagRules, error)

NewFromFile reads filename and returns TagRules

func NewFromString

func NewFromString(rulesDef string) (TagRules, error)

NewFromString parses rulesDef and returns TagRules

Jump to

Keyboard shortcuts

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