mod_tag

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModTag = "mod_tag"
)

Variables

This section is empty.

Functions

func TagRuleCheck

func TagRuleCheck(tagRuleFile *TagRuleFile) error

Types

type ConfModTag

type ConfModTag struct {
	Basic struct {
		DataPath string // path of rule data
	}

	Log struct {
		OpenDebug bool
	}
}

func ConfLoad

func ConfLoad(filePath string, confRoot string) (*ConfModTag, error)

func (*ConfModTag) Check

func (cfg *ConfModTag) Check(confRoot string) error

type ModuleTag

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

func NewModuleTag

func NewModuleTag() *ModuleTag

func (*ModuleTag) Init

func (*ModuleTag) Name

func (m *ModuleTag) Name() string

type ProductRuleList

type ProductRuleList map[string]TagRuleList // product => list of tag rule list

type ProductRuleRawList

type ProductRuleRawList map[string]RuleRawList // product => raw rule list

type RuleRawList

type RuleRawList []TagRuleRaw

type TagParam

type TagParam struct {
	TagName  string `json:"TagName"`
	TagValue string `json:"TagValue"`
}

type TagRule

type TagRule struct {
	Cond  condition.Condition
	Param TagParam
	Last  bool // if true, not to check the next rule in the list if the condition is satisfied
}

type TagRuleConf

type TagRuleConf struct {
	Version string          // version
	Config  ProductRuleList // product -> rule list
}

func TagRuleFileLoad

func TagRuleFileLoad(filename string) (*TagRuleConf, error)

type TagRuleFile

type TagRuleFile struct {
	Version string             // version
	Config  ProductRuleRawList // product -> raw rule list
}

type TagRuleList

type TagRuleList []TagRule

type TagRuleRaw

type TagRuleRaw struct {
	Cond  string   // condition
	Param TagParam // tag param
	Last  bool     // if true, not to check the next rule in the list if the condition is satisfied
}

type TagRuleTable

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

func NewTagRuleTable

func NewTagRuleTable() *TagRuleTable

func (*TagRuleTable) Search

func (t *TagRuleTable) Search(product string) (TagRuleList, bool)

func (*TagRuleTable) Update

func (t *TagRuleTable) Update(ruleConf *TagRuleConf)

Jump to

Keyboard shortcuts

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