Documentation
¶
Index ¶
- type KindMatcher
- type KindMatchers
- type MatchLabelsMatcher
- type Matchers
- type Parameter
- type Rego
- func (r Rego) Dependencies() []string
- func (r Rego) Description() string
- func (r Rego) Enforcement() string
- func (r Rego) FullSource() string
- func (r Rego) Kind() string
- func (r Rego) Matchers() (Matchers, error)
- func (r Rego) Name() string
- func (r Rego) Parameters() []Parameter
- func (r Rego) Path() string
- func (r Rego) PolicyID() string
- func (r Rego) Severity() Severity
- func (r Rego) SkipConstraint() bool
- func (r Rego) Source() string
- func (r Rego) Title() string
- type Severity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KindMatcher ¶ added in v0.8.0
KindMatcher are the matchers that are applied to constraints.
type KindMatchers ¶ added in v0.10.0
type KindMatchers []KindMatcher
KindMatchers is the slice of KindMatcher
func (KindMatchers) String ¶ added in v0.10.0
func (k KindMatchers) String() string
type MatchLabelsMatcher ¶ added in v0.10.0
MatchLabelsMatcher is the matcher to generate `constraints.spec.match.labelSelector.matchLabels`.
func (MatchLabelsMatcher) String ¶ added in v0.10.0
func (m MatchLabelsMatcher) String() string
type Matchers ¶ added in v0.8.0
type Matchers struct { KindMatchers KindMatchers MatchLabelsMatcher MatchLabelsMatcher }
Matchers are all of the matchers that can be applied to constraints.
type Rego ¶ added in v0.8.0
type Rego struct {
// contains filtered or unexported fields
}
Rego represents a parsed rego file.
func GetAllSeverities ¶ added in v0.8.0
GetAllSeverities gets all of the rego files found in the given directory as well as any subdirectories. Only rego files that contain a valid severity will be returned.
func GetAllSeveritiesWithoutImports ¶ added in v0.14.2
GetAllSeveritiesWithoutImports gets all of the Rego files found in the given directory as well as any subdirectories, but does not attempt to parse the imports.
func GetViolations ¶ added in v0.8.0
GetViolations gets all of the files found in the given directory as well as any subdirectories. Only rego files that have a severity of violation will be returned.
func (Rego) Dependencies ¶ added in v0.8.0
Dependencies returns all of the source for the rego files that this rego file depends on.
func (Rego) Description ¶ added in v0.8.0
Description returns the entire description found in the header comment of the rego file.
func (Rego) Enforcement ¶ added in v0.8.0
Enforcement returns the enforcement action in the header comment Defaults to deny if no enforcement action is specified
func (Rego) FullSource ¶ added in v0.15.0
FullSource returns the original source code inside of the rego file including comments except the header
func (Rego) Kind ¶ added in v0.8.0
Kind returns the Kubernetes Kind of the rego file. The kind of the rego file is determined by the name of the directory that the rego file exists in.
func (Rego) Name ¶ added in v0.8.0
Name returns the name of the rego file. The name of the rego file is its kind as lowercase.
func (Rego) Parameters ¶ added in v0.9.0
Parameters returns the list of parsed parameters
func (Rego) PolicyID ¶ added in v0.9.0
PolicyID returns the identifier of the policy The returned value will be a blank string if an id was not specified in the policy body
func (Rego) Severity ¶ added in v0.8.0
Severity returns the severity of the rego file. When a rego file has multiple rules that are considered to be different severities, the first rule is chosen.
func (Rego) SkipConstraint ¶ added in v0.12.0
SkipConstraint returns whether or not the generation of the Constraint should be skipped It is only set to true when the @skip-constraint tag is present in the comment header block