definition

package
v0.0.0-...-094b1a8 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition

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

func NewDefinition

func NewDefinition(
	projectPath arch.PathAbsolute,
	usedContext arch.UsedContext,
	reader reader,
	validator validator,
	assembler assembler,
) *Definition

func (*Definition) FromAbsoluteFile

func (def *Definition) FromAbsoluteFile(filePath arch.PathAbsolute) (arch.Spec, error)

FromAbsoluteFile will find and parse config file in any directory, but all paths defined inside config will be related to project directory anyway see also: FromRelativeFile

func (*Definition) FromCode

func (def *Definition) FromCode(builders ...cfg.Factory) (arch.Spec, error)

FromCode will transform GO code struct into config and then build spec from this config for example:

  • FromAbsoluteFile -> will read .yml as `config` and build arch.Spec from it
  • FromCode -> will transform preConfig into `config` and build arch.Spec from it

func (*Definition) FromDefaultFile

func (def *Definition) FromDefaultFile() (arch.Spec, error)

FromDefaultFile will parse config from "{projectDirectory}/.go-arch-lint.yml" see also: FromRelativeFile, FromAbsoluteFile

func (*Definition) FromRelativeFile

func (def *Definition) FromRelativeFile(path arch.PathRelative) (arch.Spec, error)

FromRelativeFile will find and parse config file RELATIVE to your project directory you can also use FromDefaultFile() (for use default file ".go-arch-lint.yml")

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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