kubernetesk8s.io/kubernetes/pkg/kubectl/apply/parse Index | Files

package parse

import "k8s.io/kubernetes/pkg/kubectl/apply/parse"

Index

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.

Source Files

factory.go item.go list_element.go map_element.go openapi.go primitive_element.go type_element.go util.go visitor.go

Version
v1.14.1
Published
Apr 5, 2019
Platform
js/wasm
Imports
7 packages
Last checked
2 minutes ago

Tools for package owners.