Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package config handles loading and validation of certification configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterPolicyPacks

func FilterPolicyPacks(packs []domain.PolicyPack, cfg domain.PolicyConfig) []domain.PolicyPack

FilterPolicyPacks applies enable/disable config to policy packs.

func Load

func Load(data []byte) (domain.Config, error)

Load parses YAML bytes into a validated Config with defaults applied.

func LoadFile

func LoadFile(path string) (domain.Config, error)

LoadFile reads and parses a config YAML file.

func LoadFromDir

func LoadFromDir(dir string) (domain.Config, error)

LoadFromDir loads config.yml from a directory (typically .certification/).

func LoadPolicyPack

func LoadPolicyPack(path string) (domain.PolicyPack, error)

LoadPolicyPack loads a single policy pack from a YAML file.

func LoadPolicyPacks

func LoadPolicyPacks(dir string) ([]domain.PolicyPack, error)

LoadPolicyPacks loads all *.yml/*.yaml policy packs from a directory.

func NewPolicyMatcher

func NewPolicyMatcher(packs []domain.PolicyPack) *policy.Matcher

NewPolicyMatcher creates a policy matcher from loaded policy packs.

Types

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError describes a single validation issue.

func ValidateConfig

func ValidateConfig(cfg domain.Config) []ValidationError

ValidateConfig checks a Config for structural issues.

func ValidatePolicyPack

func ValidatePolicyPack(p domain.PolicyPack) []ValidationError

ValidatePolicyPack checks a PolicyPack for structural issues.

func (ValidationError) Error

func (e ValidationError) Error() string

Jump to

Keyboard shortcuts

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