Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyYAML is an empty body error. ErrEmptyYAML = errors.New("body is empty") )
Functions ¶
func ImportYaml ¶
func ImportYaml(r io.Reader) (*TypeSpec, Properties, error)
ImportYaml converts a reader containing YAML to a TypeSpec and Properties.
Types ¶
type Properties ¶
type Properties map[interface{}]interface{}
Properties are document properties
func (Properties) Name ¶
func (p Properties) Name() (string, error)
Name extract name or generateName from metadata. If either are not found, it returns an error.
func (Properties) Paths ¶
func (p Properties) Paths(gvk GVK) []PropertyPath
Paths returns a list of paths in properties.
func (Properties) Value ¶
func (p Properties) Value(path []string) (interface{}, error)
Value returns the value at a path.
type PropertyPath ¶
type PropertyPath struct { Path []string Value interface{} }
PropertyPath contains a property path.
type TypeSpec ¶
type TypeSpec struct { // APIVersion is the api version of the object. APIVersion string // RawKind is the unformatted kind for the object. RawKind string }
TypeSpec describes an object's type.
func NewTypeSpec ¶
NewTypeSpec creates an instance of TypeSpec.
type ValueExtractor ¶
type ValueExtractor struct {
// contains filtered or unexported fields
}
ValueExtractor extracts Values from a manifest.
func NewValueExtractor ¶
func NewValueExtractor(root *astext.Object) *ValueExtractor
NewValueExtractor creates an instance of ValueExtractor.
func ValueExtractorFactory ¶
func ValueExtractorFactory() (*ValueExtractor, error)
ValueExtractorFactory returns a value extractor.
func (*ValueExtractor) Extract ¶
func (ve *ValueExtractor) Extract(gvk GVK, props Properties) (map[string]Values, error)
Extract extracts values from an object.
Click to show internal directories.
Click to hide internal directories.