models

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: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProjectInfoDefaultArchFileName  = ".go-arch-lint.yml"
	ProjectInfoDefaultGoModFileName = "go.mod"
)
View Source
const SupportedVersion = 3

Variables

View Source
var OutputTypeVariantsConst = []string{
	OutputTypeASCII,
	OutputTypeJSON,
}

Functions

This section is empty.

Types

type Annotation added in v1.7.1

type Annotation struct {
	Text      string    `json:"Text"`
	Reference Reference `json:"Reference"`
}

type Check

type Check 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"`
}

type CheckArchWarningDeepscan added in v1.7.1

type CheckArchWarningDeepscan struct {
	Gate       DeepscanWarningGate
	Dependency DeepscanWarningDependency
	Target     DeepscanWarningTarget
}

type CheckArchWarningDependency

type CheckArchWarningDependency struct {
	ComponentName      string    `json:"ComponentName"`
	FileRelativePath   string    `json:"FileRelativePath"`
	FileAbsolutePath   string    `json:"FileAbsolutePath"`
	ResolvedImportName string    `json:"ResolvedImportName"`
	Reference          Reference `json:"-"`
	SourceCodePreview  []byte    `json:"-"`
}

type CheckArchWarningMatch

type CheckArchWarningMatch struct {
	FileRelativePath  string    `json:"FileRelativePath"`
	FileAbsolutePath  string    `json:"FileAbsolutePath"`
	Reference         Reference `json:"-"`
	SourceCodePreview []byte    `json:"-"`
}

type CheckNotice

type CheckNotice struct {
	Text              string `json:"Text"`
	File              string `json:"File"`
	Line              int    `json:"Line"`
	Offset            int    `json:"Offset"`
	SourceCodePreview []byte `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 CodeReference added in v1.7.1

type CodeReference struct {
	Pointer  Reference
	LineFrom int
	LineTo   int
}

func NewCodeReference added in v1.7.1

func NewCodeReference(pointer Reference, lineFrom, lineTo int) CodeReference

func NewCodeReferenceRelative added in v1.7.1

func NewCodeReferenceRelative(pointer Reference, relTop, relBottom int) CodeReference

type DeepscanWarningDependency added in v1.7.1

type DeepscanWarningDependency struct {
	ComponentName     string    // repository
	Name              string    // micro.ViewRepository
	InjectionAST      string    // c.provideMicroViewRepository()
	Injection         Reference // 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    // operations
	MethodName    string    // NewOperation
	Definition    Reference // 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 {
	RelativePath string `json:"-"` // internal/app/internal/container/cmd_mapping.go:15
}

type Error

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

type FileHold

type FileHold struct {
	File        ProjectFile
	ComponentID *string
}

type FlagsCheck

type FlagsCheck struct {
	Project     ProjectInfo
	MaxWarnings int
}

type FlagsMapping

type FlagsMapping struct {
	Project ProjectInfo
	Scheme  MappingScheme
}

type FlagsRoot

type FlagsRoot struct {
	UseColors         bool
	OutputType        OutputType
	OutputJsonOneLine bool
}

type FlagsSchema

type FlagsSchema struct {
	Version    int
	JSONSchema string
}

type FlagsSelfInspect added in v1.7.1

type FlagsSelfInspect struct {
	Project ProjectInfo
}

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 ImportType

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

type Mapping

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

type MappingGrouped

type MappingGrouped struct {
	ComponentName string
	FileNames     []string
}

type MappingList

type MappingList struct {
	FileName      string
	ComponentName string
}

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 ProjectInfo

type ProjectInfo struct {
	Directory      string
	GoArchFilePath string
	GoModFilePath  string
	ModuleName     string
}

type Referable

type Referable interface {
	Reference() Reference
}

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 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() Reference

type Reference

type Reference struct {
	Valid  bool
	File   string
	Line   int
	Offset int
}

type ResolvedImport

type ResolvedImport struct {
	Name       string
	ImportType ImportType
}

type ResolvedPath

type ResolvedPath struct {
	ImportPath string
	LocalPath  string
	AbsPath    string
}

type Schema

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

type SelfInspect added in v1.7.1

type SelfInspect struct {
	LinterVersion string       `json:"LinterVersion"`
	Notices       []Annotation `json:"Notices"`
	Suggestions   []Annotation `json:"Suggestions"`
}

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

type Version

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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