parse

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElementBuildingVisitor

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

ElementBuildingVisitor creates an Elements from Items An Element combines the values from the Item with the field metadata.

func (ElementBuildingVisitor) CreateListElement

func (v ElementBuildingVisitor) CreateListElement(item *listItem) (apply.Element, error)

CreateListElement creates a ListElement

func (ElementBuildingVisitor) CreateMapElement

func (v ElementBuildingVisitor) CreateMapElement(item *mapItem) (apply.Element, error)

CreateMapElement creates a mapElement

func (ElementBuildingVisitor) CreatePrimitiveElement

func (v ElementBuildingVisitor) CreatePrimitiveElement(item *primitiveItem) (apply.Element, error)

CreatePrimitiveElement creates a primitiveElement

func (ElementBuildingVisitor) CreateTypeElement

func (v ElementBuildingVisitor) CreateTypeElement(item *typeItem) (apply.Element, error)

CreateTypeElement creates a typeElement

type Factory

type Factory struct {
	// Resources contains the openapi field metadata for the object models
	Resources openapi.Resources
}

Factory creates an Element by combining object values from recorded, local and remote sources with the metadata from an openapi schema.

func (*Factory) CreateElement

func (b *Factory) CreateElement(recorded, local, remote map[string]interface{}) (apply.Element, error)

CreateElement returns an Element by collating the recorded, local and remote field values

type Item

type Item interface {
	// CreateElement merges the values in the item into a combined Element
	CreateElement(ItemVisitor) (apply.Element, error)
}

Item wraps values from 3 sources (recorded, local, remote). The values are not collated

type ItemVisitor

type ItemVisitor interface {
	// CreatePrimitiveElement builds an Element for a primitiveItem
	CreatePrimitiveElement(*primitiveItem) (apply.Element, error)

	// CreateListElement builds an Element for a listItem
	CreateListElement(*listItem) (apply.Element, error)

	// CreateMapElement builds an Element for a mapItem
	CreateMapElement(*mapItem) (apply.Element, error)

	// CreateTypeElement builds an Element for a typeItem
	CreateTypeElement(*typeItem) (apply.Element, error)
}

ItemVisitor provides an interface for Items to Accept and call the Visit function that corresponds to its actual type.

Jump to

Keyboard shortcuts

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