resolver

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CircularReferenceResult

type CircularReferenceResult struct {
	Journey   []*index.Reference
	Start     *index.Reference
	LoopIndex int
	LoopPoint *index.Reference
}

CircularReferenceResult contains a circular reference found when traversing the graph.

func (*CircularReferenceResult) GenerateJourneyPath

func (c *CircularReferenceResult) GenerateJourneyPath() string

type Resolver

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

Resolver will use a *index.SpecIndex to stitch together a resolved root tree using all the discovered references in the doc.

func NewResolver

func NewResolver(index *index.SpecIndex) *Resolver

NewResolver will create a new resolver from a *index.SpecIndex

func (*Resolver) GetCircularErrors

func (resolver *Resolver) GetCircularErrors() []*CircularReferenceResult

GetCircularErrors returns all errors found during resolving

func (*Resolver) GetResolvingErrors

func (resolver *Resolver) GetResolvingErrors() []*ResolvingError

GetResolvingErrors returns all errors found during resolving

func (*Resolver) Resolve

func (resolver *Resolver) Resolve() []*ResolvingError

Resolve will resolve the specification, everything that is not polymorphic and not circular, will be resolved. this data can get big, it results in a massive duplication of data.

func (*Resolver) VisitReference

func (resolver *Resolver) VisitReference(ref *index.Reference, seen map[string]bool, journey []*index.Reference) []*yaml.Node

VisitReference will visit a reference as part of a journey and will return resolved nodes.

type ResolvingError

type ResolvingError struct {
	Error error
	Node  *yaml.Node
	Path  string
}

ResolvingError represents an issue the resolver had trying to stitch the tree together.

Jump to

Keyboard shortcuts

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