decoder

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchV1

type ArchV1 struct {
	FVersion            ref[int]                                    `json:"version"`
	FAllow              ArchV1Allow                                 `json:"allow"`
	FExclude            []ref[string]                               `json:"exclude"`
	FExcludeFilesRegExp []ref[string]                               `json:"excludeFiles"`
	FVendors            map[spec.VendorName]ref[ArchV1Vendor]       `json:"vendors"`
	FCommonVendors      []ref[string]                               `json:"commonVendors"`
	FComponents         map[spec.ComponentName]ref[ArchV1Component] `json:"components"`
	FCommonComponents   []ref[string]                               `json:"commonComponents"`
	FDependencies       map[spec.ComponentName]ref[ArchV1Rule]      `json:"deps"`
}

ArchV1 initial config schema

func (*ArchV1) CommonComponents

func (a *ArchV1) CommonComponents() []common.Referable[string]

func (*ArchV1) CommonVendors

func (a *ArchV1) CommonVendors() []common.Referable[string]

func (*ArchV1) Components

func (a *ArchV1) Components() spec.Components

func (*ArchV1) Dependencies

func (a *ArchV1) Dependencies() spec.Dependencies

func (*ArchV1) ExcludedDirectories

func (a *ArchV1) ExcludedDirectories() []common.Referable[string]

func (*ArchV1) ExcludedFilesRegExp

func (a *ArchV1) ExcludedFilesRegExp() []common.Referable[string]

func (*ArchV1) Options

func (a *ArchV1) Options() spec.Options

func (*ArchV1) Vendors

func (a *ArchV1) Vendors() spec.Vendors

func (*ArchV1) Version

func (a *ArchV1) Version() common.Referable[int]

func (*ArchV1) WorkingDirectory

func (a *ArchV1) WorkingDirectory() common.Referable[string]

type ArchV1Allow

type ArchV1Allow struct {
	FDepOnAnyVendor ref[bool] `json:"depOnAnyVendor"`
}

func (ArchV1Allow) DeepScan

func (a ArchV1Allow) DeepScan() common.Referable[bool]

func (ArchV1Allow) IsDependOnAnyVendor

func (a ArchV1Allow) IsDependOnAnyVendor() common.Referable[bool]

type ArchV1Component

type ArchV1Component struct {
	FLocalPath string `json:"in"`
}

func (ArchV1Component) RelativePaths

func (a ArchV1Component) RelativePaths() []models.Glob

type ArchV1Rule

type ArchV1Rule struct {
	FMayDependOn    []ref[string] `json:"mayDependOn"`
	FCanUse         []ref[string] `json:"canUse"`
	FAnyProjectDeps ref[bool]     `json:"anyProjectDeps"`
	FAnyVendorDeps  ref[bool]     `json:"anyVendorDeps"`
}

func (ArchV1Rule) AnyProjectDeps

func (a ArchV1Rule) AnyProjectDeps() common.Referable[bool]

func (ArchV1Rule) AnyVendorDeps

func (a ArchV1Rule) AnyVendorDeps() common.Referable[bool]

func (ArchV1Rule) CanUse

func (a ArchV1Rule) CanUse() []common.Referable[string]

func (ArchV1Rule) DeepScan

func (a ArchV1Rule) DeepScan() common.Referable[bool]

func (ArchV1Rule) MayDependOn

func (a ArchV1Rule) MayDependOn() []common.Referable[string]

type ArchV1Vendor

type ArchV1Vendor struct {
	FImportPath string `json:"in"`
}

func (ArchV1Vendor) ImportPaths

func (a ArchV1Vendor) ImportPaths() []models.Glob

type ArchV2

type ArchV2 struct {
	FVersion            ref[int]                                    `json:"version"`
	FWorkDir            ref[string]                                 `json:"workdir"`
	FAllow              ArchV2Allow                                 `json:"allow"`
	FExclude            []ref[string]                               `json:"exclude"`
	FExcludeFilesRegExp []ref[string]                               `json:"excludeFiles"`
	FVendors            map[spec.VendorName]ref[ArchV2Vendor]       `json:"vendors"`
	FCommonVendors      []ref[string]                               `json:"commonVendors"`
	FComponents         map[spec.ComponentName]ref[ArchV2Component] `json:"components"`
	FCommonComponents   []ref[string]                               `json:"commonComponents"`
	FDependencies       map[spec.ComponentName]ref[ArchV2Rule]      `json:"deps"`
}

ArchV2 changes since ArchV1: - added global "workdir" option - vendor/component "in" now accept two types: (string, []string), instead of (string)

func (*ArchV2) CommonComponents

func (a *ArchV2) CommonComponents() []common.Referable[string]

func (*ArchV2) CommonVendors

func (a *ArchV2) CommonVendors() []common.Referable[string]

func (*ArchV2) Components

func (a *ArchV2) Components() spec.Components

func (*ArchV2) Dependencies

func (a *ArchV2) Dependencies() spec.Dependencies

func (*ArchV2) ExcludedDirectories

func (a *ArchV2) ExcludedDirectories() []common.Referable[string]

func (*ArchV2) ExcludedFilesRegExp

func (a *ArchV2) ExcludedFilesRegExp() []common.Referable[string]

func (*ArchV2) Options

func (a *ArchV2) Options() spec.Options

func (*ArchV2) Vendors

func (a *ArchV2) Vendors() spec.Vendors

func (*ArchV2) Version

func (a *ArchV2) Version() common.Referable[int]

func (*ArchV2) WorkingDirectory

func (a *ArchV2) WorkingDirectory() common.Referable[string]

type ArchV2Allow

type ArchV2Allow struct {
	FDepOnAnyVendor ref[bool] `json:"depOnAnyVendor"`
}

func (ArchV2Allow) DeepScan

func (a ArchV2Allow) DeepScan() common.Referable[bool]

func (ArchV2Allow) IsDependOnAnyVendor

func (a ArchV2Allow) IsDependOnAnyVendor() common.Referable[bool]

type ArchV2Component

type ArchV2Component struct {
	FLocalPaths stringList `json:"in"`
}

func (ArchV2Component) RelativePaths

func (a ArchV2Component) RelativePaths() []models.Glob

type ArchV2Rule

type ArchV2Rule struct {
	FMayDependOn    []ref[string] `json:"mayDependOn"`
	FCanUse         []ref[string] `json:"canUse"`
	FAnyProjectDeps ref[bool]     `json:"anyProjectDeps"`
	FAnyVendorDeps  ref[bool]     `json:"anyVendorDeps"`
}

func (ArchV2Rule) AnyProjectDeps

func (a ArchV2Rule) AnyProjectDeps() common.Referable[bool]

func (ArchV2Rule) AnyVendorDeps

func (a ArchV2Rule) AnyVendorDeps() common.Referable[bool]

func (ArchV2Rule) CanUse

func (a ArchV2Rule) CanUse() []common.Referable[string]

func (ArchV2Rule) DeepScan

func (a ArchV2Rule) DeepScan() common.Referable[bool]

func (ArchV2Rule) MayDependOn

func (a ArchV2Rule) MayDependOn() []common.Referable[string]

type ArchV2Vendor

type ArchV2Vendor struct {
	FImportPaths stringList `json:"in"`
}

func (ArchV2Vendor) ImportPaths

func (a ArchV2Vendor) ImportPaths() []models.Glob

type ArchV3

type ArchV3 struct {
	FVersion            ref[int]                                    `json:"version"`
	FWorkDir            ref[string]                                 `json:"workdir"`
	FAllow              ArchV3Allow                                 `json:"allow"`
	FExclude            []ref[string]                               `json:"exclude"`
	FExcludeFilesRegExp []ref[string]                               `json:"excludeFiles"`
	FVendors            map[spec.VendorName]ref[ArchV3Vendor]       `json:"vendors"`
	FCommonVendors      []ref[string]                               `json:"commonVendors"`
	FComponents         map[spec.ComponentName]ref[ArchV3Component] `json:"components"`
	FCommonComponents   []ref[string]                               `json:"commonComponents"`
	FDependencies       map[spec.ComponentName]ref[ArchV3Rule]      `json:"deps"`
}

ArchV3 changes since ArchV2: - added deepScan option in allow and deps rules

func (*ArchV3) CommonComponents

func (a *ArchV3) CommonComponents() []common.Referable[string]

func (*ArchV3) CommonVendors

func (a *ArchV3) CommonVendors() []common.Referable[string]

func (*ArchV3) Components

func (a *ArchV3) Components() spec.Components

func (*ArchV3) Dependencies

func (a *ArchV3) Dependencies() spec.Dependencies

func (*ArchV3) ExcludedDirectories

func (a *ArchV3) ExcludedDirectories() []common.Referable[string]

func (*ArchV3) ExcludedFilesRegExp

func (a *ArchV3) ExcludedFilesRegExp() []common.Referable[string]

func (*ArchV3) Options

func (a *ArchV3) Options() spec.Options

func (*ArchV3) Vendors

func (a *ArchV3) Vendors() spec.Vendors

func (*ArchV3) Version

func (a *ArchV3) Version() common.Referable[int]

func (*ArchV3) WorkingDirectory

func (a *ArchV3) WorkingDirectory() common.Referable[string]

type ArchV3Allow

type ArchV3Allow struct {
	FDepOnAnyVendor ref[bool] `json:"depOnAnyVendor"`
	FDeepScan       ref[bool] `json:"deepScan"`
}

func (ArchV3Allow) DeepScan

func (a ArchV3Allow) DeepScan() common.Referable[bool]

func (ArchV3Allow) IsDependOnAnyVendor

func (a ArchV3Allow) IsDependOnAnyVendor() common.Referable[bool]

type ArchV3Component

type ArchV3Component struct {
	FLocalPaths stringList `json:"in"`
}

func (ArchV3Component) RelativePaths

func (a ArchV3Component) RelativePaths() []models.Glob

type ArchV3Rule

type ArchV3Rule struct {
	FMayDependOn    []ref[string] `json:"mayDependOn"`
	FCanUse         []ref[string] `json:"canUse"`
	FAnyProjectDeps ref[bool]     `json:"anyProjectDeps"`
	FAnyVendorDeps  ref[bool]     `json:"anyVendorDeps"`
	FDeepScan       ref[bool]     `json:"deepScan"`
}

func (ArchV3Rule) AnyProjectDeps

func (a ArchV3Rule) AnyProjectDeps() common.Referable[bool]

func (ArchV3Rule) AnyVendorDeps

func (a ArchV3Rule) AnyVendorDeps() common.Referable[bool]

func (ArchV3Rule) CanUse

func (a ArchV3Rule) CanUse() []common.Referable[string]

func (ArchV3Rule) DeepScan

func (a ArchV3Rule) DeepScan() common.Referable[bool]

func (ArchV3Rule) MayDependOn

func (a ArchV3Rule) MayDependOn() []common.Referable[string]

type ArchV3Vendor

type ArchV3Vendor struct {
	FImportPaths stringList `json:"in"`
}

func (ArchV3Vendor) ImportPaths

func (a ArchV3Vendor) ImportPaths() []models.Glob

type Decoder

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

func NewDecoder

func NewDecoder(
	yamlReferenceResolver yamlSourceCodeReferenceResolver,
	jsonSchemaProvider jsonSchemaProvider,
) *Decoder

func (*Decoder) Decode

func (sp *Decoder) Decode(archFile string) (spec.Document, []arch.Notice, error)

Jump to

Keyboard shortcuts

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