resolver

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) CheckForCircularReferences added in v0.0.5

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

CheckForCircularReferences Check for circular references, without resolving, a non-destructive run.

func (*Resolver) GetCircularErrors

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

GetCircularErrors returns all circular reference errors found.

func (*Resolver) GetNonPolymorphicCircularErrors added in v0.0.5

func (resolver *Resolver) GetNonPolymorphicCircularErrors() []*index.CircularReferenceResult

GetNonPolymorphicCircularErrors returns all circular errors that DO NOT stem from polymorphism

func (*Resolver) GetPolymorphicCircularErrors added in v0.0.5

func (resolver *Resolver) GetPolymorphicCircularErrors() []*index.CircularReferenceResult

GetPolymorphicCircularErrors returns all circular errors that stem from polymorphism

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. This is a destructive method and will permanently re-organize the node tree. Make sure you have copied your original tree before running this (if you want to preserve original data)

func (*Resolver) VisitReference

func (resolver *Resolver) VisitReference(ref *index.Reference, seen map[string]bool, journey []*index.Reference, resolve bool) []*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