types

package
v0.0.0-...-e78c8ab Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 68

Documentation

Index

Constants

View Source
const (
	TracingDisabledHeader = "Trace: TRACING DISABLED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Trace   *string
	Target  string
	Results []*Result
}

Response is a collection of Constraint violations for a particular Target. Each Result represents a violation for a distinct Constraint.

func (*Response) AddResult

func (r *Response) AddResult(results *Result)

func (*Response) Sort

func (r *Response) Sort()

Sort sorts the Results in Response lexicographically first by the Constraint Kind, and then by Constraint Name.

func (*Response) TraceDump

func (r *Response) TraceDump() string

type Responses

type Responses struct {
	ByTarget     map[string]*Response
	Handled      map[string]bool
	StatsEntries []*instrumentation.StatsEntry
}

func NewResponses

func NewResponses() *Responses

func (*Responses) HandledCount

func (r *Responses) HandledCount() int

func (*Responses) Results

func (r *Responses) Results() []*Result

func (*Responses) TraceDump

func (r *Responses) TraceDump() string

type Result

type Result struct {
	// Target is the target this violation is for.
	Target string `json:"target"`

	Msg string `json:"msg,omitempty"`

	// Metadata includes the contents of `details` from the Rego rule signature
	Metadata map[string]interface{} `json:"metadata,omitempty"`

	// The constraint that was violated
	Constraint *unstructured.Unstructured `json:"constraint,omitempty"`

	// The enforcement action of the constraint
	EnforcementAction string `json:"enforcementAction,omitempty"`

	// The scoped actions of the constraint
	ScopedEnforcementActions []string `json:"scopedActions,omitempty"`
}

Jump to

Keyboard shortcuts

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