validator

package
v0.0.0-...-aaa4723 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = log.New(ioutil.Discard, "[go-deptrac] ", log.LstdFlags|log.Lshortfile)

Functions

This section is empty.

Types

type Collector

type Collector struct {
	Type string `yaml:"type"`

	Regex string `yaml:"regex"`
	// contains filtered or unexported fields
}

type CollectorType

type CollectorType uint
const (
	Directory CollectorType = 1 << iota
)

type Config

type Config struct {
	Paths        []string `yaml:"paths"`
	ExcludeFiles []string `yaml:"exclude_files"`
	Layers       []Layer  `yaml:"layers"`
	Ruleset      Ruleset  `yaml:"ruleset"`
	// contains filtered or unexported fields
}

func ParseConfig

func ParseConfig(configPaths []string) Config

type File

type File struct {
	FilePath FilePath
	Package  Package
	Imports  []*ast.ImportSpec
	Layers   []LayerName
}

type FilePath

type FilePath = string

type Layer

type Layer struct {
	Name       LayerName   `yaml:"name"`
	Collectors []Collector `yaml:"collectors"`
}

type LayerName

type LayerName = string

type Package

type Package = string

type Ruleset

type Ruleset map[LayerName][]LayerName

type ValidationError

type ValidationError error

type Validator

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

func NewValidator

func NewValidator(config Config) *Validator

NewValidator creates new Validator.

func (*Validator) Validate

func (v *Validator) Validate(ignoreTests bool) (bool, []ValidationError, error)

Jump to

Keyboard shortcuts

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