model

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	Line int

	IssueType  model.IssueType
	Path       []PathItem
	Value      interface{}
	Attributes map[string]interface{}
}

Condition represents a condition from a rule that should be checked

func (Condition) Attr

func (c Condition) Attr(name string) (interface{}, bool)

Attr add some configurations to the condition to return the condition to be matched

func (Condition) AttrAsString

func (c Condition) AttrAsString(name string) (string, bool)

AttrAsString gets Attr and converts to string

type PathItem

type PathItem struct {
	Name string
	Type PathItemType
}

PathItem represents json's element name and type

type PathItemType

type PathItemType string

PathItemType represents which type of path that item belongs on json representation

const (
	PathTypeDefault      PathItemType = "DEFAULT"
	PathTypeResource     PathItemType = "RESOURCE"
	PathTypeResourceType PathItemType = "RESOURCE_TYPE"
	PathTypeResourceName PathItemType = "RESOURCE_NAME"
)

Constants for kinds of PathItemTypes

type Rule

type Rule struct {
	Conditions []Condition
}

Rule represents a list of conditions to validate a rule

Jump to

Keyboard shortcuts

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