engine

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFindings

func ApplyFindings(findings []Finding, repoPath string) error

ApplyFindings applies the given findings to the repository filesystem.

func EvaluateCondition

func EvaluateCondition(condition string, values, providedValues map[string]interface{}) (bool, error)

EvaluateCondition checks whether a template selector condition matches the current repo config. Empty conditions always match.

Types

type Boundary

type Boundary struct {
	Type  string // start_of_file, end_of_file, line, content, contains
	Value string // For line: number string; for content/contains: match text
}

Boundary defines where a section starts or ends in a file.

type Finding

type Finding struct {
	FilePath  string `json:"file_path"`
	Operation string `json:"operation"`
	Message   string `json:"message"`
	Expected  string `json:"expected,omitempty"`
	Actual    string `json:"actual,omitempty"`
}

Finding represents a single compliance finding for a file.

func ComputeFindings

func ComputeFindings(repoCfg *config.RepoConfig, centralCfg *config.CentralConfig, repoPath string) ([]Finding, error)

ComputeFindings computes the compliance findings for a repo.

type ParsedTemplate

type ParsedTemplate struct {
	Sections         []Section
	BootstrapContent string
	HasBootstrap     bool
	IsWholeFile      bool
	OriginalContent  string
}

ParsedTemplate is the result of parsing section directives from a template. If no directives are found, IsWholeFile is true and the template should replace the entire file (backward compatible).

type Section

type Section struct {
	Start   Boundary
	End     Boundary
	Content string
}

Section represents a managed section of a file defined in a template.

type TemplateData

type TemplateData struct {
	Name          string
	DefaultBranch string
	Config        map[string]interface{}
	// contains filtered or unexported fields
}

TemplateData is the data passed to template files for rendering.

Jump to

Keyboard shortcuts

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