rules

package
v0.0.0-...-dc35164 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package rules defines validation method for each rule set in rule.proto.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountRequiredTables

func CountRequiredTables(ruleList []*pb.TypeRule, records map[string]dmiparser.Record) bool

CountRequiredTables verifies the number of tables in each type

func RuleUnmarshal

func RuleUnmarshal(path string) ([]*pb.TypeRule, error)

RuleUnmarshal parses the rule textproto into rule.proto format.

Types

type TypeRule

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

TypeRule defines the struct of *pb.TypeRule.

func GetTypeRule

func GetTypeRule(typeID string, rules []*pb.TypeRule) TypeRule

GetTypeRule returns the TypeRule for a single type of table.

func (TypeRule) NotEmpty

func (TR TypeRule) NotEmpty() bool

NotEmpty returns true when TypeRule for specific typeID is found.

func (TypeRule) ValidateAll

func (TR TypeRule) ValidateAll(handleID string, records map[string]dmiparser.Record) bool

ValidateAll checks all rules within one type including conditional rules.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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