models

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultProjectPath   = "./"
	DefaultArchFileName  = ".go-arch-lint.yml"
	DefaultGoModFileName = "go.mod"
)
View Source
const (
	SupportedVersionMin = 1
	SupportedVersionMax = 3
)
View Source
const UnknownVersion = "dev"

Variables

View Source
var GraphTypesValues = []string{
	GraphTypeFlow,
	GraphTypeDI,
}
View Source
var MappingSchemesValues = []string{
	MappingSchemeList,
	MappingSchemeGrouped,
}
View Source
var OutputTypeValues = []string{
	OutputTypeASCII,
	OutputTypeJSON,
}

Functions

This section is empty.

Types

type CheckArchWarningDeepscan added in v1.7.1

type CheckArchWarningDeepscan struct {
	Gate       DeepscanWarningGate       `json:"Gate"`
	Dependency DeepscanWarningDependency `json:"Dependency"`
	Target     DeepscanWarningTarget     `json:"Target"`
}

type CheckArchWarningDependency

type CheckArchWarningDependency struct {
	ComponentName      string           `json:"ComponentName"`
	FileRelativePath   string           `json:"FileRelativePath"`
	FileAbsolutePath   string           `json:"FileAbsolutePath"`
	ResolvedImportName string           `json:"ResolvedImportName"`
	Reference          common.Reference `json:"Reference"`
}

type CheckArchWarningMatch

type CheckArchWarningMatch struct {
	FileRelativePath string           `json:"FileRelativePath"`
	FileAbsolutePath string           `json:"FileAbsolutePath"`
	Reference        common.Reference `json:"-"`
}

type CheckNotice

type CheckNotice struct {
	Text              string `json:"Text"`
	File              string `json:"File"`
	Line              int    `json:"Line"`
	Column            int    `json:"Offset"`
	SourceCodePreview []byte `json:"-"`
}

type CheckQuality added in v1.11.0

type CheckQuality struct {
	ID   string `json:"ID"`
	Used bool   `json:"Used"`
	Name string `json:"-"`
	Hint string `json:"-"`
}

type CheckResult

type CheckResult struct {
	DependencyWarnings []CheckArchWarningDependency
	MatchWarnings      []CheckArchWarningMatch
	DeepscanWarnings   []CheckArchWarningDeepscan
}

func (*CheckResult) Append added in v1.7.1

func (cr *CheckResult) Append(another CheckResult)

func (*CheckResult) HasNotices added in v1.7.1

func (cr *CheckResult) HasNotices() bool

type CmdCheckIn added in v1.9.0

type CmdCheckIn struct {
	ProjectPath string
	ArchFile    string
	MaxWarnings int
}

type CmdCheckOut added in v1.9.0

type CmdCheckOut struct {
	DocumentNotices        []CheckNotice                `json:"ExecutionWarnings"`
	ArchHasWarnings        bool                         `json:"ArchHasWarnings"`
	ArchWarningsDependency []CheckArchWarningDependency `json:"ArchWarningsDeps"`
	ArchWarningsMatch      []CheckArchWarningMatch      `json:"ArchWarningsNotMatched"`
	ArchWarningsDeepScan   []CheckArchWarningDeepscan   `json:"ArchWarningsDeepScan"`
	OmittedCount           int                          `json:"OmittedCount"`
	ModuleName             string                       `json:"ModuleName"`
	Qualities              []CheckQuality               `json:"Qualities"`
}

type CmdErrorOut added in v1.9.0

type CmdErrorOut struct {
	Error string `json:"Error"`
}

type CmdGraphIn added in v1.9.0

type CmdGraphIn struct {
	ProjectPath    string
	ArchFile       string
	Type           GraphType
	OutFile        string
	Focus          string
	IncludeVendors bool
	ExportD2       bool
	OutputType     OutputType
}

type CmdGraphOut added in v1.9.0

type CmdGraphOut struct {
	ProjectDirectory string `json:"ProjectDirectory"`
	ModuleName       string `json:"ModuleName"`
	OutFile          string `json:"OutFile"`
	D2Definitions    string `json:"D2Definitions"`
	ExportD2         bool   `json:"-"`
}

type CmdMappingIn added in v1.9.0

type CmdMappingIn struct {
	ProjectPath string
	ArchFile    string
	Scheme      MappingScheme
}

type CmdMappingOut added in v1.9.0

type CmdMappingOut struct {
	ProjectDirectory string                 `json:"ProjectDirectory"`
	ModuleName       string                 `json:"ModuleName"`
	MappingGrouped   []CmdMappingOutGrouped `json:"MappingGrouped"`
	MappingList      []CmdMappingOutList    `json:"MappingList"`
	Scheme           MappingScheme          `json:"-"`
}

type CmdMappingOutGrouped added in v1.9.0

type CmdMappingOutGrouped struct {
	ComponentName string
	FileNames     []string
}

type CmdMappingOutList added in v1.9.0

type CmdMappingOutList struct {
	FileName      string
	ComponentName string
}

type CmdSchemaIn added in v1.9.0

type CmdSchemaIn struct {
	Version int
}

type CmdSchemaOut added in v1.9.0

type CmdSchemaOut struct {
	Version    int    `json:"Version"`
	JSONSchema string `json:"JsonSchema"`
}

type CmdSelfInspectIn added in v1.9.0

type CmdSelfInspectIn struct {
	ProjectPath string
	ArchFile    string
}

type CmdSelfInspectOut added in v1.9.0

type CmdSelfInspectOut struct {
	ModuleName    string                        `json:"ModuleName"`
	RootDirectory string                        `json:"RootDirectory"`
	LinterVersion string                        `json:"LinterVersion"`
	Notices       []CmdSelfInspectOutAnnotation `json:"Notices"`
	Suggestions   []CmdSelfInspectOutAnnotation `json:"Suggestions"`
}

type CmdSelfInspectOutAnnotation added in v1.9.0

type CmdSelfInspectOutAnnotation struct {
	Text      string           `json:"Text"`
	Reference common.Reference `json:"Reference"`
}

type CmdVersionOut added in v1.9.0

type CmdVersionOut struct {
	LinterVersion       string `json:"LinterVersion"`
	GoArchFileSupported string `json:"GoArchFileSupported"`
	BuildTime           string `json:"BuildTime"`
	CommitHash          string `json:"CommitHash"`
}

type DeepscanWarningDependency added in v1.7.1

type DeepscanWarningDependency struct {
	ComponentName     string           `json:"ComponentName"` // repository
	Name              string           `json:"Name"`          // micro.ViewRepository
	InjectionAST      string           `json:"InjectionAST"`  // c.provideMicroViewRepository()
	Injection         common.Reference `json:"Injection"`     // internal/app/internal/container/cmd_mapping.go:15
	InjectionPath     string           `json:"-"`             // internal/app/internal/container/cmd_mapping.go:15
	SourceCodePreview []byte           `json:"-"`
}

type DeepscanWarningGate added in v1.7.1

type DeepscanWarningGate struct {
	ComponentName string           `json:"ComponentName"` // operations
	MethodName    string           `json:"MethodName"`    // NewOperation
	Definition    common.Reference `json:"Definition"`    // internal/glue/code/line_count.go:54
	RelativePath  string           `json:"-"`             // internal/glue/code/line_count.go:54
}

type DeepscanWarningTarget added in v1.7.1

type DeepscanWarningTarget struct {
	Definition   common.Reference `json:"Definition"`
	RelativePath string           `json:"-"` // internal/app/internal/container/cmd_mapping.go:15
}

type FileHold

type FileHold struct {
	File        ProjectFile
	ComponentID *string
}

type FlagsRoot

type FlagsRoot struct {
	UseColors         bool
	OutputType        OutputType
	OutputJsonOneLine bool
}

type Glob added in v1.7.1

type Glob string

func (Glob) Match added in v1.7.1

func (glob Glob) Match(testedPath string) (bool, error)

Match check if path is subset of glob, for example:

  • github.com/**/library/*/abc

will match:

  • github.com/a/b/c/library/any/abc
  • github.com/test/library/another/awesome

and not match:

  • github.com/a/b/c/library/any
  • github.com/library/another/awesome

type GraphType added in v1.8.0

type GraphType = string
const (
	GraphTypeFlow GraphType = "flow"
	GraphTypeDI   GraphType = "di"
)

type ImportType

type ImportType uint8
const (
	ImportTypeStdLib ImportType = iota
	ImportTypeProject
	ImportTypeVendor
)

type MappingScheme

type MappingScheme = string
const (
	MappingSchemeGrouped MappingScheme = "grouped"
	MappingSchemeList    MappingScheme = "list"
)

type OutputType

type OutputType = string
const (
	OutputTypeDefault OutputType = "default"
	OutputTypeASCII   OutputType = "ascii"
	OutputTypeJSON    OutputType = "json"
)

type ProjectFile

type ProjectFile struct {
	Path    string
	Imports []ResolvedImport
}

type ReferableErr added in v1.7.1

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

func NewReferableErr added in v1.7.1

func NewReferableErr(err error, ref common.Reference) ReferableErr

func (ReferableErr) Error added in v1.7.1

func (r ReferableErr) Error() string

func (ReferableErr) Is added in v1.7.1

func (r ReferableErr) Is(err error) bool

func (ReferableErr) Reference added in v1.7.1

func (r ReferableErr) Reference() common.Reference

type ResolvedImport

type ResolvedImport struct {
	Name       string
	ImportType ImportType
	Reference  common.Reference
}

type ResolvedPath

type ResolvedPath struct {
	ImportPath string
	LocalPath  string
	AbsPath    string
}

type UserSpaceError

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

func NewUserSpaceError

func NewUserSpaceError(msg string) UserSpaceError

func (UserSpaceError) Error

func (u UserSpaceError) Error() string

func (UserSpaceError) Is

func (u UserSpaceError) Is(err error) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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