compliance

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateReport

func GenerateReport(results []Result, ok bool) string

func Register

func Register(id string, f Factory)

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func BuildEngine

func BuildEngine(configs []RuleConfig) (*Engine, error)

func (*Engine) Evaluate

func (e *Engine) Evaluate(ctx context.Context, pr *scm.PullRequest) ([]Result, bool)

type Factory

type Factory func(config map[string]interface{}) (Rule, error)

Factory para instanciar regras via config

type Result

type Result struct {
	RuleID   string
	Name     string
	Passed   bool
	Severity Severity
	Message  string
}

type Rule

type Rule interface {
	ID() string
	Validate(ctx context.Context, pr *scm.PullRequest) (Result, error)
}

Rule define o contrato que os plugins devem implementar

func Instantiate

func Instantiate(id string, config map[string]interface{}) (Rule, error)

type RuleConfig

type RuleConfig struct {
	ID      string                 `mapstructure:"id"`
	Enabled bool                   `mapstructure:"enabled"`
	Params  map[string]interface{} `mapstructure:"params"`
}

RuleConfig mapeia o YAML

type Severity

type Severity string
const (
	SeverityStop Severity = "STOP"
	SeverityInfo Severity = "INFO"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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