yamlprocessor

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package yamlprocessor ...

Package yamlprocessor ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefinitionParser

type DefinitionParser interface {
	// ParsePath returns the path specified within the template definition.
	ParsePath([]byte) ([]v1alpha1.PathInfo, error)
}

DefinitionParser provides behavior to process template definition

type YTTDefinitionParser

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

YTTDefinitionParser is a struct for parsing ytt definitions

func NewYttDefinitionParser

func NewYttDefinitionParser(opts ...YttDefinitionParserOpts) *YTTDefinitionParser

NewYttDefinitionParser returns a YTTDefinitionParser

func (*YTTDefinitionParser) ParsePath

func (y *YTTDefinitionParser) ParsePath(artifact []byte) ([]v1alpha1.PathInfo, error)

ParsePath returns the path specified within the template definition. The definition is of type TemplateDefinition.

type YTTProcessor

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

YTTProcessor a type for processing and parsing ytt files.

func NewYttProcessor

func NewYttProcessor(opts ...YttProcessorOption) *YTTProcessor

NewYttProcessor returns an instance of the YTTProcessor.

func NewYttProcessorWithConfigDir

func NewYttProcessorWithConfigDir(configDir string) *YTTProcessor

NewYttProcessorWithConfigDir returns an instance of the YTTProcessor configured with tkg config directory

func (*YTTProcessor) GetClusterClassTemplateName added in v0.18.0

func (p *YTTProcessor) GetClusterClassTemplateName(version, name string) string

GetClusterClassTemplateName returns the file name of the cluster class template that needs to be retrieved from the source.

func (*YTTProcessor) GetTemplateName

func (p *YTTProcessor) GetTemplateName(version, plan string) string

GetTemplateName returns the name of the template definition file for the specified version and plan.

func (*YTTProcessor) GetVariableMap added in v0.11.0

func (p *YTTProcessor) GetVariableMap(rawArtifact []byte) (map[string]*string, error)

GetVariableMap returns a map of the variables specified in the yaml.

func (*YTTProcessor) GetVariables

func (p *YTTProcessor) GetVariables(rawArtifact []byte) ([]string, error)

GetVariables returns a list of the variables specified from the ytt data values.

func (*YTTProcessor) Process

func (p *YTTProcessor) Process(rawArtifact []byte, variablesClient func(string) (string, error)) ([]byte, error)

Process returns the final yaml of the ytt templates.

type YttDefinitionParserOpts

type YttDefinitionParserOpts func(*YTTDefinitionParser)

YttDefinitionParserOpts a type for defining functions that modify the ytt parser

func InjectTKGDir

func InjectTKGDir(path string) YttDefinitionParserOpts

InjectTKGDir is a YttDefinitionParserOpts that allows the tkg directory to be overridden.

type YttProcessorOption

type YttProcessorOption func(*YTTProcessor)

YttProcessorOption is a type that mutates ytt based on options defined in the option

func InjectDefinitionParser

func InjectDefinitionParser(dp DefinitionParser) YttProcessorOption

InjectDefinitionParser is a YttProcessorOption that allows overriding of the definition parser.

Jump to

Keyboard shortcuts

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