spec

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoTableFound = fmt.Errorf("no table found")
View Source
var ErrNotEnoughRowsInTable = fmt.Errorf("not enough value rows in table")

Functions

func AccessToASCIIDocString

func AccessToASCIIDocString(a matter.Access, entityType types.EntityType) string

func AssignDocType added in v1.6.0

func AssignDocType(sectionInfoCache SectionInfoCache, docInfoCache DocumentInfoCache, reader asciidoc.Reader, doc *asciidoc.Document) error

func AssignSectionNames added in v1.5.46

func AssignSectionNames(sectionInfoCache SectionInfoCache, reader asciidoc.Reader, doc *asciidoc.Document) error

func AssignSectionTypes

func AssignSectionTypes(sectionInfoCache SectionInfoCache, docInfoCache DocumentInfoCache, reader asciidoc.Reader, doc *asciidoc.Document, top *asciidoc.Section) (err error)

func Build added in v1.5.42

func Build(cxt context.Context, parserOptions ParserOptions, processingOptions pipeline.ProcessingOptions, builderOptions []BuilderOption, docs DocSet, attributes []asciidoc.AttributeName) (specification *Specification, specDocs DocSet, err error)

func CanonicalName

func CanonicalName(name string) string

func DefaultColumnValue added in v1.6.0

func DefaultColumnValue(reader asciidoc.Reader, ti *TableInfo, row *asciidoc.TableRow, column matter.TableColumn, entityType types.EntityType) string

func DeriveSpecPathFromPaths

func DeriveSpecPathFromPaths(paths []string) string

func FindFirstTable

func FindFirstTable(reader asciidoc.Reader, section *asciidoc.Section) *asciidoc.Table

func GetDataType added in v1.5.41

func GetDataType(sectionInfoCache SectionInfoCache, reader asciidoc.Reader, doc *asciidoc.Document, s *asciidoc.Section) (*types.DataType, error)

func MergeViolations added in v1.5.56

func MergeViolations(v1, v2 map[string][]Violation) (v map[string][]Violation)

func NewSource

func NewSource(d *asciidoc.Document, e asciidoc.Element) *source

func NewSpecPath

func NewSpecPath(path string, rootPath string) (asciidoc.Path, error)

func Parse

func Parse(cxt context.Context, parserOptions ParserOptions, processingOptions pipeline.ProcessingOptions, builderOptions []BuilderOption, attributes []asciidoc.AttributeName) (specification *Specification, specDocs DocSet, err error)

func ParseAccess

func ParseAccess(vc string, entityType types.EntityType) (a matter.Access, parsed bool)

func ParseCommandDirection

func ParseCommandDirection(s string) matter.Interface

func ReadFile

func ReadFile(path string, rootPath string) (*asciidoc.Document, error)

func ReferenceName

func ReferenceName(reader asciidoc.Reader, element any) string

func RenderTableCell

func RenderTableCell(reader asciidoc.Reader, cell *asciidoc.TableCell) (string, error)

func Targeter

func Targeter(specRoot string) func(cxt context.Context) ([]string, error)

func Validate

func Validate(spec *Specification)

Types

type Anchor

type Anchor struct {
	Library       *Library
	Document      *asciidoc.Document
	Source        matter.Source
	ID            asciidoc.Elements
	LabelElements asciidoc.Elements
	Element       asciidoc.Element
	Parent        asciidoc.Parent
}

func NewAnchor

func NewAnchor(library *Library, doc *asciidoc.Document, id asciidoc.Elements, element asciidoc.Element, parent asciidoc.Parent, label ...asciidoc.Element) *Anchor

func (*Anchor) Name

func (a *Anchor) Name(reader asciidoc.Reader) string

type Builder

type Builder struct {
	Spec *Specification
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(specRoot string, config *config.Config, errata *errata.Collection, options ...BuilderOption) Builder

func (Builder) Name

func (sp Builder) Name() string

func (*Builder) Process

func (sp *Builder) Process(cxt context.Context, inputs []*pipeline.Data[*Library]) (outputs []*pipeline.Data[*asciidoc.Document], err error)

type BuilderOption

type BuilderOption func(tg *Builder)

func IgnoreHierarchy

func IgnoreHierarchy(ignore bool) BuilderOption

func PatchForSdk added in v1.6.0

func PatchForSdk(patch bool) BuilderOption

type BuilderOptions

type BuilderOptions struct {
	IgnoreHierarchy bool `default:"false" help:"ignore hierarchy" group:"Spec:"`
}

func (BuilderOptions) List added in v1.5.41

func (bo BuilderOptions) List() (options []BuilderOption)

type CellRenderer

type CellRenderer func(reader asciidoc.Reader, cellElements asciidoc.Elements, sb *strings.Builder) (source asciidoc.Element)

type ClusterReferenceNameMismatch

type ClusterReferenceNameMismatch struct {
	Cluster *matter.Cluster
	Name    string
	Source  log.Source
}

func (ClusterReferenceNameMismatch) Error

func (ClusterReferenceNameMismatch) Origin

func (ddt ClusterReferenceNameMismatch) Origin() (path string, line int)

func (ClusterReferenceNameMismatch) Type

type ColumnIndex

type ColumnIndex map[matter.TableColumn]int

func (ColumnIndex) HasAll

func (ci ColumnIndex) HasAll(columns ...matter.TableColumn) bool

func (ColumnIndex) HasAny

func (ci ColumnIndex) HasAny(columns ...matter.TableColumn) bool

type ConformanceChoiceMismatchError added in v1.6.0

type ConformanceChoiceMismatchError struct {
	Set    string
	Source log.Source

	Entity              types.Entity
	ChoiceLimit         conformance.ChoiceLimit
	Previous            types.Entity
	PreviousChoiceLimit conformance.ChoiceLimit
}

func (ConformanceChoiceMismatchError) Error added in v1.6.0

func (ConformanceChoiceMismatchError) Origin added in v1.6.0

func (ccme ConformanceChoiceMismatchError) Origin() (path string, line int)

func (ConformanceChoiceMismatchError) Type added in v1.6.0

type ConformanceChoiceOrphanError added in v1.6.0

type ConformanceChoiceOrphanError struct {
	Set    string
	Source log.Source
}

func (ConformanceChoiceOrphanError) Error added in v1.6.0

func (ccoe ConformanceChoiceOrphanError) Error() string

func (ConformanceChoiceOrphanError) Origin added in v1.6.0

func (ccoe ConformanceChoiceOrphanError) Origin() (path string, line int)

func (ConformanceChoiceOrphanError) Type added in v1.6.0

type CrossReference

type CrossReference struct {
	Document  *asciidoc.Document
	Reference *asciidoc.CrossReference
	Parent    asciidoc.Parent
	Source    matter.Source
}

type DeviceTypeReferenceNameMismatch

type DeviceTypeReferenceNameMismatch struct {
	DeviceType *matter.DeviceType
	Name       string
	Source     log.Source
}

func (DeviceTypeReferenceNameMismatch) Error

func (DeviceTypeReferenceNameMismatch) Origin

func (ddt DeviceTypeReferenceNameMismatch) Origin() (path string, line int)

func (DeviceTypeReferenceNameMismatch) Type

type DeviceTypeSet

type DeviceTypeSet pipeline.Map[string, *pipeline.Data[[]*matter.DeviceType]]

type DocCache added in v1.6.0

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

func NewDocCache added in v1.6.0

func NewDocCache(root string) *DocCache

func (DocCache) Add added in v1.6.0

func (dc DocCache) Add(doc *asciidoc.Document)

type DocSet

func LoadSpecDocs added in v1.6.0

func LoadSpecDocs(cxt context.Context, parserOptions ParserOptions, processingOptions pipeline.ProcessingOptions) (specDocs DocSet, err error)

func NewDocSet

func NewDocSet() DocSet

type DocumentInfoCache added in v1.6.0

type DocumentInfoCache interface {
	DocType(document *asciidoc.Document) (matter.DocType, error)
	SetDocType(document *asciidoc.Document, docType matter.DocType)
	Parents(document *asciidoc.Document) []*asciidoc.Document
}

type DuplicateEntityIDError

type DuplicateEntityIDError struct {
	Entity   types.Entity
	Previous types.Entity
}

func (DuplicateEntityIDError) Error

func (ddt DuplicateEntityIDError) Error() string

func (DuplicateEntityIDError) Origin

func (ddt DuplicateEntityIDError) Origin() (path string, line int)

func (DuplicateEntityIDError) Type

func (ddt DuplicateEntityIDError) Type() ErrorType

type DuplicateEntityNameError

type DuplicateEntityNameError struct {
	Entity   types.Entity
	Previous types.Entity
}

func (DuplicateEntityNameError) Error

func (ddt DuplicateEntityNameError) Error() string

func (DuplicateEntityNameError) Origin

func (ddt DuplicateEntityNameError) Origin() (path string, line int)

func (DuplicateEntityNameError) Type

type ElementRequirementUnknownElementError

type ElementRequirementUnknownElementError struct {
	Requirement *matter.ElementRequirement
}

func (ElementRequirementUnknownElementError) Error

func (ElementRequirementUnknownElementError) Origin

func (ddt ElementRequirementUnknownElementError) Origin() (path string, line int)

func (ElementRequirementUnknownElementError) Type

type ElementRequirementUnreferencedClusterError

type ElementRequirementUnreferencedClusterError struct {
	Requirement *matter.ElementRequirement
}

func (ElementRequirementUnreferencedClusterError) Error

func (ElementRequirementUnreferencedClusterError) Origin

func (ddt ElementRequirementUnreferencedClusterError) Origin() (path string, line int)

func (ElementRequirementUnreferencedClusterError) Type

type EntityRefs

type EntityRefs[T comparable] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewEntityRefs

func NewEntityRefs[T comparable]() EntityRefs[T]

func (*EntityRefs[T]) Add

func (cr *EntityRefs[T]) Add(c T, m types.Entity)

func (*EntityRefs[T]) Get

func (cr *EntityRefs[T]) Get(m types.Entity) (pipeline.Map[T, struct{}], bool)

type Error

type Error interface {
	Type() ErrorType
	Error() string
	log.Source
}

type ErrorType

type ErrorType uint16
const (
	ErrorTypeUnknown ErrorType = iota
	ErrorTypeGenericParse
	ErrorTypeDuplicateEntityID
	ErrorTypeDuplicateEntityName
	ErrorTypeUnknownConstraintIdentifier
	ErrorTypeUnknownConstraintReference
	ErrorTypeUnknownCustomDataType
	ErrorTypeUnknownSuperset
	ErrorTypeUnknownClusterRequirement
	ErrorTypeUnknownElementRequirementCluster
	ErrorTypeElementRequirementUnreferencedCluster
	ErrorTypeElementRequirementUnknownElement
	ErrorTypeComposingDeviceTypeRequirementUnknownDeviceType
	ErrorTypeComposingDeviceTypeClusterRequirementUnknownCluster
	ErrorTypeComposingDeviceTypeClusterRequirementUnknownDeviceType
	ErrorTypeComposingDeviceTypeClusterRequirementUnreferencedDeviceType
	ErrorTypeComposingDeviceTypeElementRequirementUnknownCluster
	ErrorTypeComposingDeviceTypeElementRequirementUnknownDeviceType
	ErrorTypeComposingDeviceTypeElementRequirementUnreferencedDeviceType
	ErrorTypeConditionRequirementUnknownDeviceType
	ErrorTypeConditionRequirementUnreferencedDeviceType
	ErrorTypeConditionRequirementUnknownCondition
	ErrorTypeTagRequirementUnreferencedDeviceType
	ErrorTypeTagRequirementUnknownNamespace
	ErrorTypeTagRequirementNamespaceNameMismatch
	ErrorTypeTagRequirementUnknownTag
	ErrorTypeTagRequirementTagNameMismatch
	ErrorTypeClusterReferenceNameMismatch
	ErrorTypeDeviceTypeReferenceNameMismatch
	ErrorTypeNamespaceNameMismatch
	ErrorTypeUnknownBaseCluster
	ErrorTypeUnknownConformanceIdentifier
	ErrorTypeUnknownConformanceReference
	ErrorTypeFabricScopingNotAllowed
	ErrorTypeFabricSensitivityNotAllowed
	ErrorTypeFabricScopedStructNotAllowed
	ErrorTypeInvalidConformance
	ErrorTypeInvalidConstraint
	ErrorTypeInvalidFallback
	ErrorTypeConformanceChoiceOrphan
	ErrorTypeConformanceChoiceMismatch
)

type ExtraColumn

type ExtraColumn struct {
	Name   string
	Offset int
}

type FabricScopedStructNotAllowedError

type FabricScopedStructNotAllowedError struct {
	Entity types.Entity
}

func (FabricScopedStructNotAllowedError) ComparableEntity added in v1.5.56

func (cf FabricScopedStructNotAllowedError) ComparableEntity() types.Entity

func (FabricScopedStructNotAllowedError) Error

func (FabricScopedStructNotAllowedError) Origin

func (cf FabricScopedStructNotAllowedError) Origin() (path string, line int)

func (FabricScopedStructNotAllowedError) Type

type FabricScopingNotAllowedError

type FabricScopingNotAllowedError struct {
	Entity types.Entity
}

func (FabricScopingNotAllowedError) ComparableEntity added in v1.5.56

func (cf FabricScopingNotAllowedError) ComparableEntity() types.Entity

func (FabricScopingNotAllowedError) Error

func (FabricScopingNotAllowedError) Origin

func (cf FabricScopingNotAllowedError) Origin() (path string, line int)

func (FabricScopingNotAllowedError) Type

type FabricSensitivityNotAllowedError

type FabricSensitivityNotAllowedError struct {
	Entity types.Entity
}

func (FabricSensitivityNotAllowedError) ComparableEntity added in v1.5.56

func (cf FabricSensitivityNotAllowedError) ComparableEntity() types.Entity

func (FabricSensitivityNotAllowedError) Error

func (FabricSensitivityNotAllowedError) Origin

func (cf FabricSensitivityNotAllowedError) Origin() (path string, line int)

func (FabricSensitivityNotAllowedError) Type

type FilterOptions

type FilterOptions struct {
	Paths         []string `arg:"" optional:"" help:"Paths of AsciiDoc files to use for generation" group:"Spec:"`
	Exclude       []string `short:"e"  help:"exclude files matching this file pattern" group:"Spec:"`
	Force         bool     `default:"false" help:"generate files even if there were spec parsing errors" group:"Spec:"`
	IgnoreErrored bool     `default:"false" help:"ignore any spec files with parsing errors" group:"Spec:"`
}

type GenericParseError added in v1.5.39

type GenericParseError struct {
	Source log.Source
	// contains filtered or unexported fields
}

func (GenericParseError) Origin added in v1.5.39

func (gpe GenericParseError) Origin() (path string, line int)

func (GenericParseError) Type added in v1.5.39

func (gpe GenericParseError) Type() ErrorType

type InvalidConformanceError

type InvalidConformanceError struct {
	Conformance string
	Source      log.Source
}

func (InvalidConformanceError) Error

func (ddt InvalidConformanceError) Error() string

func (InvalidConformanceError) Origin

func (cf InvalidConformanceError) Origin() (path string, line int)

func (InvalidConformanceError) Type

type InvalidConstraintError

type InvalidConstraintError struct {
	Constraint string
	Source     log.Source
}

func (InvalidConstraintError) Error

func (ice InvalidConstraintError) Error() string

func (InvalidConstraintError) Origin

func (ice InvalidConstraintError) Origin() (path string, line int)

func (InvalidConstraintError) Type

func (ice InvalidConstraintError) Type() ErrorType

type InvalidFallbackError

type InvalidFallbackError struct {
	Fallback string
	Source   log.Source
}

func (InvalidFallbackError) Error

func (ifbe InvalidFallbackError) Error() string

func (InvalidFallbackError) Origin

func (ifbe InvalidFallbackError) Origin() (path string, line int)

func (InvalidFallbackError) Type

func (ifbe InvalidFallbackError) Type() ErrorType

type Library added in v1.6.0

type Library struct {
	Root *asciidoc.Document
	Spec *Specification

	Errata *errata.Collection

	asciidoc.Reader

	Docs []*asciidoc.Document
	// contains filtered or unexported fields
}

func NewLibrary added in v1.6.0

func NewLibrary(root *asciidoc.Document, config config.Library, errata *errata.Collection, cache *DocCache) *Library

func (*Library) Anchors added in v1.6.0

func (library *Library) Anchors(reader asciidoc.Reader) (map[string][]*Anchor, error)

func (*Library) CrossReferences added in v1.6.0

func (library *Library) CrossReferences(id string) []*CrossReference

func (*Library) CrossReferencesForDoc added in v1.6.0

func (library *Library) CrossReferencesForDoc(doc *asciidoc.Document) map[string][]*CrossReference

func (*Library) DiscoErrata added in v1.6.0

func (library *Library) DiscoErrata(path string) *errata.Disco

func (*Library) DocType added in v1.6.0

func (library *Library) DocType(doc *asciidoc.Document) (matter.DocType, error)

func (*Library) EntitiesForElement added in v1.6.0

func (library *Library) EntitiesForElement(element asciidoc.Attributable) (entities []types.Entity, ok bool)

func (*Library) ErrataForPath added in v1.6.0

func (library *Library) ErrataForPath(docPath string) *errata.Errata

func (*Library) FindAnchor added in v1.6.0

func (library *Library) FindAnchor(id string, source log.Source) *Anchor

func (*Library) FindAnchorByID added in v1.6.0

func (library *Library) FindAnchorByID(id asciidoc.Elements, element asciidoc.ParentElement, source log.Source) *Anchor

func (*Library) FindAnchors added in v1.6.0

func (library *Library) FindAnchors(id string) []*Anchor

func (*Library) FindSectionByType added in v1.6.0

func (library *Library) FindSectionByType(reader asciidoc.Reader, doc *asciidoc.Document, top *asciidoc.Section, sectionType matter.Section) *asciidoc.Section

func (*Library) GetHeaderCellString added in v1.6.0

func (library *Library) GetHeaderCellString(reader asciidoc.Reader, cell *asciidoc.TableCell) (string, error)

func (*Library) Identifier added in v1.6.0

func (library *Library) Identifier(parent asciidoc.Parent, element asciidoc.Element, id asciidoc.Elements) string

func (*Library) IsUtilityPath added in v1.6.0

func (library *Library) IsUtilityPath(path asciidoc.Path) bool

func (*Library) Parents added in v1.6.0

func (library *Library) Parents(doc *asciidoc.Document) []*asciidoc.Document

func (*Library) Preparse added in v1.6.0

func (library *Library) Preparse(specRoot string, attributes []asciidoc.AttributeName) (err error)

func (*Library) SdkErrata added in v1.6.0

func (library *Library) SdkErrata(path string) *errata.SDK

func (*Library) SectionLevel added in v1.6.0

func (library *Library) SectionLevel(s *asciidoc.Section) (level int)

func (*Library) SectionName added in v1.6.0

func (library *Library) SectionName(s *asciidoc.Section) (name string)

func (*Library) SectionType added in v1.6.0

func (library *Library) SectionType(s *asciidoc.Section) (st matter.Section)

func (*Library) SetDocType added in v1.6.0

func (library *Library) SetDocType(doc *asciidoc.Document, dt matter.DocType)

func (*Library) SetSectionLevel added in v1.6.0

func (library *Library) SetSectionLevel(s *asciidoc.Section, level int)

func (*Library) SetSectionName added in v1.6.0

func (library *Library) SetSectionName(s *asciidoc.Section, name string)

func (*Library) SetSectionType added in v1.6.0

func (library *Library) SetSectionType(s *asciidoc.Section, st matter.Section)

func (*Library) SpecErrata added in v1.6.0

func (library *Library) SpecErrata(path string) *errata.Spec

func (*Library) SyncCrossReference added in v1.6.0

func (library *Library) SyncCrossReference(cr *CrossReference, id asciidoc.Elements)

func (*Library) SyncToDoc added in v1.6.0

func (library *Library) SyncToDoc(a *Anchor, id asciidoc.Elements)

type LibraryBuilder added in v1.6.0

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

func NewLibraryBuilder added in v1.6.0

func NewLibraryBuilder(specRoot string, config *config.Config, errata *errata.Collection) *LibraryBuilder

func (LibraryBuilder) Name added in v1.6.0

func (lb LibraryBuilder) Name() string

func (*LibraryBuilder) Process added in v1.6.0

func (lb *LibraryBuilder) Process(cxt context.Context, inputs []*pipeline.Data[*asciidoc.Document]) (outputs []*pipeline.Data[*Library], err error)

type LibraryParser added in v1.6.0

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

func NewLibraryParser added in v1.6.0

func NewLibraryParser(specRoot string, attributes []asciidoc.AttributeName) (*LibraryParser, error)

func (LibraryParser) Name added in v1.6.0

func (r LibraryParser) Name() string

func (LibraryParser) Process added in v1.6.0

func (r LibraryParser) Process(cxt context.Context, input *pipeline.Data[*Library], index int32, total int32) (outputs []*pipeline.Data[*asciidoc.Document], extras []*pipeline.Data[*Library], err error)

type LibrarySet added in v1.6.0

type LibrarySet pipeline.Map[string, *pipeline.Data[*Library]]

type NamespaceNameMismatchTagRequirementError added in v1.5.46

type NamespaceNameMismatchTagRequirementError struct {
	Requirement *matter.TagRequirement
	Namespace   *matter.Namespace
}

func (NamespaceNameMismatchTagRequirementError) Error added in v1.5.46

func (NamespaceNameMismatchTagRequirementError) Origin added in v1.5.46

func (ddt NamespaceNameMismatchTagRequirementError) Origin() (path string, line int)

func (NamespaceNameMismatchTagRequirementError) Type added in v1.5.46

type ParseErrors

type ParseErrors struct {
	Errors []Error
}

func (ParseErrors) Error

func (pe ParseErrors) Error() string

type ParserOptions

type ParserOptions struct {
	Root string `` /* 159-byte string literal not displayed */
}

func (*ParserOptions) AfterApply

func (po *ParserOptions) AfterApply() error

type Reader

type Reader struct {
	// contains filtered or unexported fields
}
func ParseFile(path asciidoc.Path, specRoot string, attributes ...asciidoc.AttributeName) (doc *asciidoc.Document, reader asciidoc.Reader, err error) {
	var contents *os.File
	contents, err = os.Open(path.Absolute)
	if err != nil {
		return
	}
	defer contents.Close()

	doc, err = ReadFile(path.Absolute, specRoot)
	if err != nil {
		err = fmt.Errorf("parse error in \"%s\": %w", path, err)
		return
	}

	reader, err = preparse(nil, doc, specRoot, attributes)
	if err != nil {
		return
	}
	return
}

func NewReader

func NewReader(parserOptions ParserOptions) (Reader, error)

func (Reader) Name

func (p Reader) Name() string

func (Reader) Process

func (p Reader) Process(cxt context.Context, input *pipeline.Data[struct{}], index int32, total int32) (outputs []*pipeline.Data[*asciidoc.Document], extras []*pipeline.Data[struct{}], err error)

func (Reader) Targets added in v1.6.0

func (p Reader) Targets(cxt context.Context) ([]string, error)

type SectionInfoCache added in v1.6.0

type SectionInfoCache interface {
	SectionName(section *asciidoc.Section) string
	SetSectionName(section *asciidoc.Section, name string)
	SectionType(section *asciidoc.Section) matter.Section
	SetSectionType(section *asciidoc.Section, sectionType matter.Section)

	ErrataForPath(docPath string) *errata.Errata
}

type SpecPullRequest added in v1.5.56

type SpecPullRequest struct {
	Base           *Specification
	BaseInProgress *Specification
	Head           *Specification
	HeadInProgress *Specification
}

func LoadSpecPullRequest added in v1.5.56

func LoadSpecPullRequest(cxt context.Context, baseRoot string, headRoot string, pipelineOptions pipeline.ProcessingOptions) (ss SpecPullRequest, err error)

type Specification

type Specification struct {
	Root   string
	Config *config.Config
	Errata *errata.Collection

	Clusters       map[*matter.Cluster]struct{}
	ClustersByID   map[uint64]*matter.Cluster
	ClustersByName map[string]*matter.Cluster

	DeviceTypes       []*matter.DeviceType
	DeviceTypesByID   map[uint64]*matter.DeviceType
	DeviceTypesByName map[string]*matter.DeviceType

	BaseDeviceType     *matter.DeviceType
	RootNodeDeviceType *matter.DeviceType

	Namespaces []*matter.Namespace

	ClusterRefs  EntityRefs[*matter.Cluster]
	DataTypeRefs EntityRefs[types.Entity]
	DocRefs      map[types.Entity]*asciidoc.Document
	LibraryRefs  map[types.Entity]*Library

	GlobalObjects types.EntitySet[*asciidoc.Document]

	Docs       map[string]*asciidoc.Document
	UnusedDocs []*asciidoc.Document
	Libraries  []*Library

	Errors []Error
	// contains filtered or unexported fields
}

func (*Specification) BuildClusterReferences

func (spec *Specification) BuildClusterReferences()

func (*Specification) BuildDataTypeReferences

func (spec *Specification) BuildDataTypeReferences()

func (*Specification) ComposeDeviceType

func (spec *Specification) ComposeDeviceType(deviceType *matter.DeviceType) (composition *matter.DeviceTypeComposition, err error)

func (*Specification) EntitiesForDocument added in v1.6.0

func (s *Specification) EntitiesForDocument(doc *asciidoc.Document) []types.Entity

func (*Specification) LibraryForDocument added in v1.6.0

func (s *Specification) LibraryForDocument(doc *asciidoc.Document) (library *Library, ok bool)

type StringReader

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

func NewStringReader

func NewStringReader(name string, rootPath string) (StringReader, error)

func (StringReader) Name

func (r StringReader) Name() string

func (StringReader) Process

func (r StringReader) Process(cxt context.Context, input *pipeline.Data[string], index int32, total int32) (outputs []*pipeline.Data[*asciidoc.Document], extras []*pipeline.Data[string], err error)

type TableInfo

type TableInfo struct {
	Doc            *asciidoc.Document
	Element        *asciidoc.Table
	Rows           []*asciidoc.TableRow
	HeaderRowIndex int
	ColumnMap      ColumnIndex
	ExtraColumns   []ExtraColumn
}

func ReadTable

func ReadTable(doc *asciidoc.Document, reader asciidoc.Reader, table *asciidoc.Table) (ti *TableInfo, err error)

func (*TableInfo) AppendColumn added in v1.6.0

func (ti *TableInfo) AppendColumn(reader asciidoc.Reader, column matter.TableColumn, entityType types.EntityType) (appendedIndex int, err error)

func (*TableInfo) Body

func (ti *TableInfo) Body() iter.Seq[*asciidoc.TableRow]

func (*TableInfo) ColumnIndex

func (ti *TableInfo) ColumnIndex(columns ...matter.TableColumn) (index int, ok bool)

func (*TableInfo) ContentRows added in v1.5.39

func (ti *TableInfo) ContentRows() iter.Seq[*asciidoc.TableRow]

func (*TableInfo) ReadConformance

func (ti *TableInfo) ReadConformance(reader asciidoc.Reader, row *asciidoc.TableRow, column matter.TableColumn) conformance.Set

func (*TableInfo) ReadConstraint

func (ti *TableInfo) ReadConstraint(library *Library, row *asciidoc.TableRow, columns ...matter.TableColumn) constraint.Constraint

func (*TableInfo) ReadDataType

func (ti *TableInfo) ReadDataType(library *Library, reader asciidoc.Reader, row *asciidoc.TableRow, column matter.TableColumn) (*types.DataType, error)

func (*TableInfo) ReadFallback

func (ti *TableInfo) ReadFallback(reader asciidoc.Reader, row *asciidoc.TableRow, columns ...matter.TableColumn) constraint.Limit

func (*TableInfo) ReadID

func (ti *TableInfo) ReadID(reader asciidoc.Reader, row *asciidoc.TableRow, columns ...matter.TableColumn) (*matter.Number, error)

func (*TableInfo) ReadLocation

func (ti *TableInfo) ReadLocation(reader asciidoc.Reader, row *asciidoc.TableRow, columns ...matter.TableColumn) (relation matter.DeviceTypeRequirementLocation, err error)

func (*TableInfo) ReadName

func (ti *TableInfo) ReadName(reader asciidoc.Reader, row *asciidoc.TableRow, columns ...matter.TableColumn) (name string, xref *asciidoc.CrossReference, err error)

func (*TableInfo) ReadNameAtOffset added in v1.5.41

func (ti *TableInfo) ReadNameAtOffset(reader asciidoc.Reader, row *asciidoc.TableRow, offset int) (name string, xref *asciidoc.CrossReference, err error)

func (*TableInfo) ReadQuality

func (ti *TableInfo) ReadQuality(reader asciidoc.Reader, row *asciidoc.TableRow, entityType types.EntityType, columns ...matter.TableColumn) (quality matter.Quality, err error)

func (*TableInfo) ReadString

func (ti *TableInfo) ReadString(reader asciidoc.Reader, row *asciidoc.TableRow, columns ...matter.TableColumn) (string, error)

func (*TableInfo) ReadStringAtOffset

func (ti *TableInfo) ReadStringAtOffset(reader asciidoc.Reader, row *asciidoc.TableRow, offset int) (string, error)

func (*TableInfo) ReadValue

func (ti *TableInfo) ReadValue(reader asciidoc.Reader, row *asciidoc.TableRow, columns ...matter.TableColumn) (string, error)

func (*TableInfo) ReadValueByIndex

func (ti *TableInfo) ReadValueByIndex(reader asciidoc.Reader, row *asciidoc.TableRow, offset int) (string, error)

func (*TableInfo) RenderColumn

func (ti *TableInfo) RenderColumn(reader asciidoc.Reader, row *asciidoc.TableRow, renderer CellRenderer, columns ...matter.TableColumn) (value string, source asciidoc.Element, ok bool)

func (*TableInfo) Rescan

func (ti *TableInfo) Rescan(doc *asciidoc.Document, reader asciidoc.Reader) (err error)

type TagNameMismatchTagRequirementError added in v1.5.46

type TagNameMismatchTagRequirementError struct {
	Requirement *matter.TagRequirement
	SemanticTag *matter.SemanticTag
}

func (TagNameMismatchTagRequirementError) Error added in v1.5.46

func (TagNameMismatchTagRequirementError) Origin added in v1.5.46

func (ddt TagNameMismatchTagRequirementError) Origin() (path string, line int)

func (TagNameMismatchTagRequirementError) Type added in v1.5.46

type UnknownBaseClusterError

type UnknownBaseClusterError struct {
	Cluster *matter.Cluster
}

func (UnknownBaseClusterError) Error

func (ddt UnknownBaseClusterError) Error() string

func (UnknownBaseClusterError) Origin

func (ddt UnknownBaseClusterError) Origin() (path string, line int)

func (UnknownBaseClusterError) Type

type UnknownClusterRequirementError

type UnknownClusterRequirementError struct {
	Requirement *matter.ClusterRequirement
}

func (UnknownClusterRequirementError) Error

func (UnknownClusterRequirementError) Origin

func (ddt UnknownClusterRequirementError) Origin() (path string, line int)

func (UnknownClusterRequirementError) Type

type UnknownComposingDeviceTypeClusterRequirementDeviceTypeError

type UnknownComposingDeviceTypeClusterRequirementDeviceTypeError struct {
	Requirement *matter.DeviceTypeClusterRequirement
}

func (UnknownComposingDeviceTypeClusterRequirementDeviceTypeError) Error

func (UnknownComposingDeviceTypeClusterRequirementDeviceTypeError) Origin

func (UnknownComposingDeviceTypeClusterRequirementDeviceTypeError) Type

type UnknownComposingDeviceTypeElementRequirementDeviceTypeError

type UnknownComposingDeviceTypeElementRequirementDeviceTypeError struct {
	Requirement *matter.DeviceTypeElementRequirement
}

func (UnknownComposingDeviceTypeElementRequirementDeviceTypeError) Error

func (UnknownComposingDeviceTypeElementRequirementDeviceTypeError) Origin

func (UnknownComposingDeviceTypeElementRequirementDeviceTypeError) Type

type UnknownComposingDeviceTypeRequirementClusterError

type UnknownComposingDeviceTypeRequirementClusterError struct {
	Requirement *matter.DeviceTypeClusterRequirement
}

func (UnknownComposingDeviceTypeRequirementClusterError) Error

func (UnknownComposingDeviceTypeRequirementClusterError) Origin

func (UnknownComposingDeviceTypeRequirementClusterError) Type

type UnknownComposingDeviceTypeRequirementDeviceTypeError

type UnknownComposingDeviceTypeRequirementDeviceTypeError struct {
	Requirement *matter.DeviceTypeRequirement
}

func (UnknownComposingDeviceTypeRequirementDeviceTypeError) Error

func (UnknownComposingDeviceTypeRequirementDeviceTypeError) Origin

func (UnknownComposingDeviceTypeRequirementDeviceTypeError) Type

type UnknownComposingDeviceTypeTagRequirementDeviceTypeError added in v1.5.46

type UnknownComposingDeviceTypeTagRequirementDeviceTypeError struct {
	Requirement *matter.DeviceTypeTagRequirement
}

func (UnknownComposingDeviceTypeTagRequirementDeviceTypeError) Error added in v1.5.46

func (UnknownComposingDeviceTypeTagRequirementDeviceTypeError) Origin added in v1.5.46

func (UnknownComposingDeviceTypeTagRequirementDeviceTypeError) Type added in v1.5.46

type UnknownComposingElementRequirementClusterError

type UnknownComposingElementRequirementClusterError struct {
	Requirement *matter.DeviceTypeElementRequirement
}

func (UnknownComposingElementRequirementClusterError) Error

func (UnknownComposingElementRequirementClusterError) Origin

func (ddt UnknownComposingElementRequirementClusterError) Origin() (path string, line int)

func (UnknownComposingElementRequirementClusterError) Type

type UnknownConditionRequirementConditionError added in v1.5.39

type UnknownConditionRequirementConditionError struct {
	Requirement *matter.ConditionRequirement
}

func (UnknownConditionRequirementConditionError) Error added in v1.5.39

func (UnknownConditionRequirementConditionError) Origin added in v1.5.39

func (ddt UnknownConditionRequirementConditionError) Origin() (path string, line int)

func (UnknownConditionRequirementConditionError) Type added in v1.5.39

type UnknownConditionRequirementDeviceTypeError added in v1.5.39

type UnknownConditionRequirementDeviceTypeError struct {
	Requirement *matter.ConditionRequirement
}

func (UnknownConditionRequirementDeviceTypeError) Error added in v1.5.39

func (UnknownConditionRequirementDeviceTypeError) Origin added in v1.5.39

func (ddt UnknownConditionRequirementDeviceTypeError) Origin() (path string, line int)

func (UnknownConditionRequirementDeviceTypeError) Type added in v1.5.39

type UnknownConformanceIdentifierError

type UnknownConformanceIdentifierError struct {
	Entity     types.Entity
	Identifier string
}

func (UnknownConformanceIdentifierError) ComparableEntity added in v1.5.56

func (cf UnknownConformanceIdentifierError) ComparableEntity() types.Entity

func (UnknownConformanceIdentifierError) Error

func (UnknownConformanceIdentifierError) Origin

func (cf UnknownConformanceIdentifierError) Origin() (path string, line int)

func (UnknownConformanceIdentifierError) Type

type UnknownConformanceReferenceError

type UnknownConformanceReferenceError struct {
	Entity    types.Entity
	Reference string
}

func (UnknownConformanceReferenceError) ComparableEntity added in v1.5.56

func (cf UnknownConformanceReferenceError) ComparableEntity() types.Entity

func (UnknownConformanceReferenceError) Error

func (UnknownConformanceReferenceError) Origin

func (cf UnknownConformanceReferenceError) Origin() (path string, line int)

func (UnknownConformanceReferenceError) Type

type UnknownConstraintIdentifierError

type UnknownConstraintIdentifierError struct {
	Identifier *constraint.IdentifierLimit
	Source     log.Source
}

func (UnknownConstraintIdentifierError) Error

func (UnknownConstraintIdentifierError) Origin

func (ddt UnknownConstraintIdentifierError) Origin() (path string, line int)

func (UnknownConstraintIdentifierError) Type

type UnknownConstraintReferenceError

type UnknownConstraintReferenceError struct {
	Reference *constraint.ReferenceLimit
	Source    log.Source
}

func (UnknownConstraintReferenceError) Error

func (UnknownConstraintReferenceError) Origin

func (ddt UnknownConstraintReferenceError) Origin() (path string, line int)

func (UnknownConstraintReferenceError) Type

type UnknownCustomDataTypeError

type UnknownCustomDataTypeError struct {
	Field    *matter.Field
	DataType *types.DataType
}

func (UnknownCustomDataTypeError) Error

func (ddt UnknownCustomDataTypeError) Error() string

func (UnknownCustomDataTypeError) Origin

func (ddt UnknownCustomDataTypeError) Origin() (path string, line int)

func (UnknownCustomDataTypeError) Type

type UnknownElementRequirementClusterError

type UnknownElementRequirementClusterError struct {
	Requirement *matter.ElementRequirement
}

func (UnknownElementRequirementClusterError) Error

func (UnknownElementRequirementClusterError) Origin

func (ddt UnknownElementRequirementClusterError) Origin() (path string, line int)

func (UnknownElementRequirementClusterError) Type

type UnknownNamespaceTagRequirementError added in v1.5.46

type UnknownNamespaceTagRequirementError struct {
	Requirement *matter.TagRequirement
}

func (UnknownNamespaceTagRequirementError) Error added in v1.5.46

func (UnknownNamespaceTagRequirementError) Origin added in v1.5.46

func (ddt UnknownNamespaceTagRequirementError) Origin() (path string, line int)

func (UnknownNamespaceTagRequirementError) Type added in v1.5.46

type UnknownSupersetError

type UnknownSupersetError struct {
	DeviceType *matter.DeviceType
}

func (UnknownSupersetError) Error

func (ddt UnknownSupersetError) Error() string

func (UnknownSupersetError) Origin

func (ddt UnknownSupersetError) Origin() (path string, line int)

func (UnknownSupersetError) Type

func (ddt UnknownSupersetError) Type() ErrorType

type UnknownTagRequirementError added in v1.5.46

type UnknownTagRequirementError struct {
	Requirement *matter.TagRequirement
}

func (UnknownTagRequirementError) Error added in v1.5.46

func (ddt UnknownTagRequirementError) Error() string

func (UnknownTagRequirementError) Origin added in v1.5.46

func (ddt UnknownTagRequirementError) Origin() (path string, line int)

func (UnknownTagRequirementError) Type added in v1.5.46

type UnreferencedComposingDeviceTypeClusterRequirementDeviceTypeError

type UnreferencedComposingDeviceTypeClusterRequirementDeviceTypeError struct {
	Requirement *matter.DeviceTypeClusterRequirement
}

func (UnreferencedComposingDeviceTypeClusterRequirementDeviceTypeError) Error

func (UnreferencedComposingDeviceTypeClusterRequirementDeviceTypeError) Origin

func (UnreferencedComposingDeviceTypeClusterRequirementDeviceTypeError) Type

type UnreferencedComposingDeviceTypeElementRequirementDeviceTypeError

type UnreferencedComposingDeviceTypeElementRequirementDeviceTypeError struct {
	Requirement *matter.DeviceTypeElementRequirement
}

func (UnreferencedComposingDeviceTypeElementRequirementDeviceTypeError) Error

func (UnreferencedComposingDeviceTypeElementRequirementDeviceTypeError) Origin

func (UnreferencedComposingDeviceTypeElementRequirementDeviceTypeError) Type

type UnreferencedConditionRequirementDeviceTypeError added in v1.5.39

type UnreferencedConditionRequirementDeviceTypeError struct {
	Requirement *matter.ConditionRequirement
}

func (UnreferencedConditionRequirementDeviceTypeError) Error added in v1.5.39

func (UnreferencedConditionRequirementDeviceTypeError) Origin added in v1.5.39

func (UnreferencedConditionRequirementDeviceTypeError) Type added in v1.5.39

type UnreferencedTagRequirementDeviceTypeError added in v1.5.45

type UnreferencedTagRequirementDeviceTypeError struct {
	Requirement *matter.DeviceTypeTagRequirement
}

func (UnreferencedTagRequirementDeviceTypeError) Error added in v1.5.45

func (UnreferencedTagRequirementDeviceTypeError) Origin added in v1.5.45

func (ddt UnreferencedTagRequirementDeviceTypeError) Origin() (path string, line int)

func (UnreferencedTagRequirementDeviceTypeError) Type added in v1.5.45

type Violation added in v1.5.56

type Violation struct {
	Type   ViolationType
	Entity types.Entity
	Path   string
	Line   int
	Text   string
}

type ViolationType added in v1.5.56

type ViolationType uint8
const (
	ViolationTypeNone ViolationType = 0

	ViolationTypeNonProvisional ViolationType = 1 << (iota - 1)
	ViolationTypeNotIfDefd
	ViolationNewParseError
)

func (ViolationType) Has added in v1.5.56

func (vt ViolationType) Has(o ViolationType) bool

func (ViolationType) String added in v1.5.56

func (vt ViolationType) String() string

Jump to

Keyboard shortcuts

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