models

package
v0.0.0-...-0e75cad Latest Latest
Warning

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

Go to latest
Published: Jul 2, 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

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

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

func (cr *CheckResult) Append(another CheckResult)

func (*CheckResult) HasNotices

func (cr *CheckResult) HasNotices() bool

type CmdCheckIn

type CmdCheckIn struct {
	ProjectPath string
	ArchFile    string
	MaxWarnings int
}

type CmdCheckOut

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

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

type CmdGraphIn

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

type CmdGraphOut

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

type CmdMappingIn

type CmdMappingIn struct {
	ProjectPath string
	ArchFile    string
	Scheme      MappingScheme
}

type CmdMappingOut

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

type CmdMappingOutGrouped

type CmdMappingOutGrouped struct {
	ComponentName string
	FileNames     []string
}

type CmdMappingOutList

type CmdMappingOutList struct {
	FileName      string
	ComponentName string
}

type CmdSchemaIn

type CmdSchemaIn struct {
	Version int
}

type CmdSchemaOut

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

type CmdSelfInspectIn

type CmdSelfInspectIn struct {
	ProjectPath string
	ArchFile    string
}

type CmdSelfInspectOut

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

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

type CmdVersionOut

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

type DeepscanWarningDependency

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

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

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

type Glob string

func (Glob) Match

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

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

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

func NewReferableErr

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

func (ReferableErr) Error

func (r ReferableErr) Error() string

func (ReferableErr) Is

func (r ReferableErr) Is(err error) bool

func (ReferableErr) Reference

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