Documentation
¶
Overview ¶
Package classify maps a Go import path to an architectural layer (controller / service / repository / other) and a best-effort module name, using folder- and naming-convention heuristics.
It is intentionally convention-driven so it works across modular-MVC and hexagonal layouts without per-project annotation. A Config can extend the keyword sets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Classifier ¶
type Classifier struct {
// contains filtered or unexported fields
}
Classifier classifies import paths into (layer, module).
func New ¶
func New(cfg *Config) *Classifier
New builds a Classifier from the default keyword sets plus any config extras.
func (*Classifier) Classify ¶
func (c *Classifier) Classify(pkgPath string) (layer, module string)
Classify returns the layer and module for an import path. Layer falls back to graph.LayerOther when nothing matches; module is "" when undeterminable.
The module is the bounded-context name. For feature-first layouts (user/service) it is the segment before the layer keyword; for layer-first layouts (core/user, interface/user, handlers/user) it is the segment after.