policydevel

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(opts *InitOptions) error

Types

type Content

type Content struct {
	YAML string
	Rego string
}

type File added in v1.35.0

type File struct {
	Path    string
	Content []byte
}

type InitOptions

type InitOptions struct {
	Directory   string
	Embedded    bool
	Force       bool
	Name        string
	Description string
}

type PolicyToLint added in v1.35.0

type PolicyToLint struct {
	Path      string
	YAMLFiles []*File
	RegoFiles []*File
	Format    bool
	Errors    []ValidationError
}

func Lookup added in v1.35.0

func Lookup(absPath string, format bool) (*PolicyToLint, error)

Read policy files from the given directory or file

func (*PolicyToLint) AddError added in v1.35.0

func (p *PolicyToLint) AddError(path, message string, line int)

Adds a new validation error

func (*PolicyToLint) HasErrors added in v1.35.0

func (p *PolicyToLint) HasErrors() bool

Returns true if any validation errors were found

func (*PolicyToLint) Validate added in v1.35.0

func (p *PolicyToLint) Validate()

type TemplateData

type TemplateData struct {
	Name         string
	Description  string
	RegoPath     string
	RegoContent  string
	Embedded     bool
	MaterialKind string
}

type ValidationError added in v1.35.0

type ValidationError struct {
	Path    string
	Line    int
	Message string
}

func (ValidationError) Error added in v1.35.0

func (e ValidationError) Error() string

Jump to

Keyboard shortcuts

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