arch

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonComponents

type CommonComponents interface {
	Reference() models.Reference

	// List of Components that can by imported to any project package
	List() []speca.Referable[string]
}

type CommonVendors

type CommonVendors interface {
	Reference() models.Reference

	// List of Vendors that can by imported to any project package
	List() []speca.Referable[string]
}

type Component

type Component interface {
	Reference() models.Reference

	// Relative package path, can contain glob's
	// example:
	// 	- internal/service/*/models/**
	// 	- /
	// 	- tests/**
	RelativePaths() []speca.Referable[models.Glob]
}

type ComponentName

type ComponentName = string

abstract ComponentName useful for mapping real packages to one Component.

type Components

type Components interface {
	Reference() models.Reference

	// describe Component packages properties
	Map() map[ComponentName]Component
}

type Dependencies

type Dependencies interface {
	Reference() models.Reference

	// Dependencies map between Components and DependencyRule`s
	Map() map[ComponentName]DependencyRule
}

type DependencyRule

type DependencyRule interface {
	Reference() models.Reference

	// List of Component names, that can by imported to described component
	MayDependOn() []speca.Referable[string]

	// List of Vendor names, that can by imported to described component
	CanUse() []speca.Referable[string]

	// described component can import any other local namespace packages
	AnyProjectDeps() speca.Referable[bool]

	// described component can import any other vendor namespace packages
	AnyVendorDeps() speca.Referable[bool]

	// override deepScan global option
	DeepScan() speca.Referable[bool]
}

type Document

type Document interface {
	Reference() models.Reference

	// Spec Version
	Version() speca.Referable[int]

	// Spec relative WorkingDirectory to root, prepend this to all path's from spec
	WorkingDirectory() speca.Referable[string]

	// Global spec Options
	Options() Options

	// ExcludedDirectories from analyze, each contain relative directory name
	ExcludedDirectories() ExcludedDirectories

	// ExcludedFilesRegExp from analyze, each project file will by matched with this regexp rules
	ExcludedFilesRegExp() ExcludedFilesRegExp

	// Map of Vendors
	Vendors() Vendors

	// List of Vendors that can by imported to any project package
	CommonVendors() CommonVendors

	// Map of Components
	Components() Components

	// List of Components that can by imported to any project package
	CommonComponents() CommonComponents

	// Dependencies map between Components and DependencyRule`s
	Dependencies() Dependencies
}

type ExcludedDirectories

type ExcludedDirectories interface {
	Reference() models.Reference

	// list of directories
	// examples:
	// 	- internal/test
	//	- vendor
	//	- .idea
	List() []speca.Referable[string]
}

type ExcludedFilesRegExp

type ExcludedFilesRegExp interface {
	Reference() models.Reference

	// list of regexp's
	// examples:
	// 	- "^.*_test\\.go$"
	List() []speca.Referable[string]
}

type Options

type Options interface {
	Reference() models.Reference

	// allow all project code depend on any third party vendor lib
	// analyze will not check imports with not local namespace's
	IsDependOnAnyVendor() speca.Referable[bool]

	// use advanced AST linter
	// this is default behavior since v3+ configs
	DeepScan() speca.Referable[bool]
}

type Vendor

type Vendor interface {
	Reference() models.Reference

	// Full import vendor qualified path
	// example:
	// 	- golang.org/x/mod/modfile
	// 	- example.com/*/libs/**
	ImportPaths() []speca.Referable[models.Glob]
}

type VendorName

type VendorName = string

abstract VendorName useful for mapping real vendor packages to one Vendor.

type Vendors

type Vendors interface {
	Reference() models.Reference

	// describe Vendor packages properties
	Map() map[VendorName]Vendor
}

Jump to

Keyboard shortcuts

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