Documentation
¶
Overview ¶
Package architecture defines the configuration and logic for architecture validation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config represents the architecture rules configuration.
func LoadConfig ¶
LoadConfig reads the architecture configuration from a YAML file.
func (*Config) AllowSelf ¶
AllowSelf returns true if dependencies within the same layer are allowed.
func (*Config) AllowUnknown ¶
AllowUnknown returns true if dependencies to or from unknown layers are allowed.
func (*Config) Allowed ¶
Allowed returns true if a dependency from fromLayer to toLayer is permitted.
func (*Config) DefaultAllowAll ¶
DefaultAllowAll returns the default behavior when a layer has no explicit allow rules.
type Layer ¶
type Layer struct {
Name string `yaml:"name"`
Patterns []string `yaml:"patterns"`
Allow []string `yaml:"allow"`
}
Layer defines a logical layer in the application and its allowed dependencies.
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher handles mapping files to architecture layers.
func NewMatcher ¶
NewMatcher creates a new architecture layer matcher.
type Settings ¶
type Settings struct {
AllowUnknown *bool `yaml:"allow_unknown"`
AllowSelf *bool `yaml:"allow_self"`
DefaultAllowAll *bool `yaml:"default_allow_all"`
}
Settings contains global architecture validation settings.
type Violation ¶
type Violation struct {
FromID string
ToID string
FromLayer string
ToLayer string
EdgeType graph.EdgeType
FromFile string
ToFile string
FromLine int
ToLine int
}
Violation represents an architectural rule violation where a dependency exists between layers that is not explicitly allowed.