validation

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompatibilityChecker

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

CompatibilityChecker validates that configurations are compatible with the target API.

func NewCompatibilityChecker

func NewCompatibilityChecker(tracker *vendors.SchemaTracker, accessor *vendors.CacheAccessor) *CompatibilityChecker

NewCompatibilityChecker creates a new compatibility checker.

func (*CompatibilityChecker) CheckSite

func (c *CompatibilityChecker) CheckSite(siteName string, siteConfig *config.SiteConfigObj) (*CompatibilityResult, error)

CheckSite performs compatibility validation on a site configuration.

type CompatibilityIssue

type CompatibilityIssue struct {
	Severity        string   // "warning", "error"
	Field           string   // field name that has the issue
	Message         string   // description of the issue
	AffectedDevices []string // list of device MACs affected
	Action          string   // suggested action to fix
}

CompatibilityIssue represents a single compatibility issue.

type CompatibilityResult

type CompatibilityResult struct {
	SiteName    string
	APIVersion  string
	LastChecked time.Time
	Issues      []CompatibilityIssue
	Compatible  bool
}

CompatibilityResult contains the results of checking API compatibility.

func (*CompatibilityResult) FilterBySeverity

func (r *CompatibilityResult) FilterBySeverity(severity string) []CompatibilityIssue

FilterBySeverity returns only issues matching the given severity.

func (*CompatibilityResult) GroupByField

func (r *CompatibilityResult) GroupByField() map[string][]CompatibilityIssue

GroupByField groups issues by field name for easier reporting.

func (*CompatibilityResult) HasErrors

func (r *CompatibilityResult) HasErrors() bool

HasErrors returns true if there are any error-level issues.

func (*CompatibilityResult) HasWarnings

func (r *CompatibilityResult) HasWarnings() bool

HasWarnings returns true if there are any warning-level issues.

func (*CompatibilityResult) Summary

func (r *CompatibilityResult) Summary() string

Summary returns a human-readable summary of the compatibility check.

type ConfigLinter

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

ConfigLinter validates site configuration files for common issues.

func NewConfigLinter

func NewConfigLinter(accessor *vendors.CacheAccessor) *ConfigLinter

NewConfigLinter creates a new configuration linter.

func (*ConfigLinter) LintSite

func (l *ConfigLinter) LintSite(siteName string, siteConfig *config.SiteConfigObj) (*LintResult, error)

LintSite performs comprehensive validation on a site configuration.

type LintIssue

type LintIssue struct {
	DeviceMAC  string
	DeviceName string
	Field      string
	Message    string
	Suggestion string
}

LintIssue represents a single linting issue found in the configuration.

type LintResult

type LintResult struct {
	SiteName     string
	APCount      int
	SwitchCount  int
	GatewayCount int
	Warnings     []LintIssue
	Errors       []LintIssue
}

LintResult contains the results of linting a site configuration.

Jump to

Keyboard shortcuts

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