architecture

package
v0.70.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package architecture checks the repository's component dependency contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(v Violation) string

Types

type Edge

type Edge struct{ From, To, Kind string }

type Exception

type Exception struct {
	ID      string `json:"id"`
	From    string `json:"from"`
	To      string `json:"to"`
	Kind    string `json:"kind"`
	Owner   string `json:"owner"`
	Reason  string `json:"reason"`
	Expires string `json:"expires"`
}

type Manifest

type Manifest struct {
	Version            int               `json:"version"`
	Module             string            `json:"module"`
	Categories         []string          `json:"categories"`
	Packages           map[string]string `json:"packages"`
	Owners             map[string]string `json:"owners"`
	Rules              []Rule            `json:"rules"`
	Exceptions         []Exception       `json:"exceptions"`
	DefaultRemediation string            `json:"default_remediation"`
}

func Load

func Load(r io.Reader) (Manifest, error)

type Package

type Package struct {
	ImportPath   string
	Imports      []string
	TestImports  []string
	XTestImports []string
}

func Discover

func Discover(goBinary, dir string) ([]Package, error)

type Rule

type Rule struct {
	From string `json:"from"`
	To   string `json:"to"`
	Kind string `json:"kind"`
	ID   string `json:"id"`
}

type Violation

type Violation struct {
	Edge                         Edge
	Rule, Remediation, Exception string
}

func Check

func Check(m Manifest, packages []Package, now time.Time) ([]Violation, error)

Jump to

Keyboard shortcuts

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