workspace

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2020 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	AnnotationDataValues       structmeta.AnnotationName = "data/values"
	AnnotationDataValuesSchema structmeta.AnnotationName = "data/values-schema"
)
View Source
const (
	AnnotationLibraryRef = "library/ref"
)

Variables

This section is empty.

Functions

func SortFilesInLibrary added in v0.13.0

func SortFilesInLibrary(files []*FileInLibrary)

Types

type DataLoader added in v0.27.0

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

func (DataLoader) FileData added in v0.27.0

func (l DataLoader) FileData(path string) ([]byte, error)

func (DataLoader) FilePaths added in v0.27.0

func (l DataLoader) FilePaths(path string) ([]string, error)

type DataValues added in v0.28.0

type DataValues struct {
	Doc         *yamlmeta.Document
	AfterLibMod bool
	// contains filtered or unexported fields
}

func NewDataValues added in v0.28.0

func NewDataValues(doc *yamlmeta.Document) (*DataValues, error)

func NewDataValuesWithLib added in v0.28.0

func NewDataValuesWithLib(libRefs ExtractLibRefs, doc *yamlmeta.Document, libRefStr string) (*DataValues, error)

func NewDataValuesWithOptionalLib added in v0.28.0

func NewDataValuesWithOptionalLib(doc *yamlmeta.Document, libRefStr string) (*DataValues, error)

func NewEmptyDataValues added in v0.28.0

func NewEmptyDataValues() *DataValues

func (*DataValues) Desc added in v0.28.0

func (dvd *DataValues) Desc() string

func (*DataValues) IntendedForAnotherLibrary added in v0.34.0

func (dvd *DataValues) IntendedForAnotherLibrary() bool

func (*DataValues) IsUsed added in v0.28.0

func (dvd *DataValues) IsUsed() bool

func (*DataValues) UsedInLibrary added in v0.28.0

func (dvd *DataValues) UsedInLibrary(expectedRefPiece ref.LibraryRef) *DataValues

type DataValuesPreProcessing added in v0.15.0

type DataValuesPreProcessing struct {
	IgnoreUnknownComments bool // TODO remove?
	// contains filtered or unexported fields
}

func (DataValuesPreProcessing) Apply added in v0.15.0

type DocExtractor added in v0.31.0

type DocExtractor struct {
	DocSet *yamlmeta.DocumentSet
}

func (DocExtractor) Extract added in v0.31.0

type EvalExport added in v0.23.0

type EvalExport struct {
	Path    string
	Symbols starlark.StringDict
}

type EvalResult added in v0.15.0

type EvalResult struct {
	Files   []files.OutputFile
	DocSet  *yamlmeta.DocumentSet
	Exports []EvalExport
}

type ExtractLibRefs added in v0.34.0

type ExtractLibRefs interface {
	FromStr(string) ([]ref.LibraryRef, error)
	FromAnnotation(template.NodeAnnotations) ([]ref.LibraryRef, error)
}

type FileInLibrary added in v0.5.0

type FileInLibrary struct {
	File    *files.File
	Library *Library
	// contains filtered or unexported fields
}

func (*FileInLibrary) RelativePath added in v0.15.0

func (fileInLib *FileInLibrary) RelativePath() string

type Library

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

func NewRootLibrary

func NewRootLibrary(fs []*files.File) *Library

func (*Library) CreateLibrary

func (l *Library) CreateLibrary(name string) *Library

func (*Library) FindAccessibleLibrary

func (l *Library) FindAccessibleLibrary(path string) (*Library, error)

func (*Library) FindFile

func (l *Library) FindFile(path string) (FileInLibrary, error)

func (*Library) FindLibrary

func (l *Library) FindLibrary(path string) (*Library, error)

func (*Library) ListAccessibleFiles

func (l *Library) ListAccessibleFiles() []*FileInLibrary

func (*Library) Print

func (l *Library) Print(out io.Writer)

func (*Library) PrintStr added in v0.24.0

func (l *Library) PrintStr() string

type LibraryExecutionContext added in v0.24.0

type LibraryExecutionContext struct {
	Current *Library
	Root    *Library
}

type LibraryExecutionFactory added in v0.23.0

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

func NewLibraryExecutionFactory added in v0.23.0

func NewLibraryExecutionFactory(ui ui.UI, templateLoaderOpts TemplateLoaderOpts) *LibraryExecutionFactory

func (*LibraryExecutionFactory) New added in v0.23.0

func (*LibraryExecutionFactory) WithTemplateLoaderOptsOverrides added in v0.31.0

func (f *LibraryExecutionFactory) WithTemplateLoaderOptsOverrides(overrides TemplateLoaderOptsOverrides) *LibraryExecutionFactory

type LibraryLoader added in v0.15.0

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

func NewLibraryLoader added in v0.15.0

func NewLibraryLoader(libraryCtx LibraryExecutionContext,
	ui ui.UI, templateLoaderOpts TemplateLoaderOpts,
	libraryExecFactory *LibraryExecutionFactory) *LibraryLoader

func (*LibraryLoader) Eval added in v0.15.0

func (ll *LibraryLoader) Eval(values *DataValues, libraryValues []*DataValues, librarySchemas []*schema.DocumentSchemaEnvelope) (*EvalResult, error)

func (*LibraryLoader) Schemas added in v0.31.0

func (*LibraryLoader) Values added in v0.15.0

func (ll *LibraryLoader) Values(valuesOverlays []*DataValues, schema Schema) (*DataValues, []*DataValues, error)

type LibraryModule added in v0.23.0

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

func NewLibraryModule added in v0.23.0

func NewLibraryModule(libraryCtx LibraryExecutionContext,
	libraryExecutionFactory *LibraryExecutionFactory,
	libraryValues []*DataValues, librarySchemas []*schema.DocumentSchemaEnvelope) LibraryModule

func (LibraryModule) AsModule added in v0.23.0

func (b LibraryModule) AsModule() starlark.StringDict

func (LibraryModule) Get added in v0.23.0

func (b LibraryModule) Get(thread *starlark.Thread, f *starlark.Builtin,
	args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

type OverlayPostProcessing added in v0.15.0

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

func (OverlayPostProcessing) Apply added in v0.15.0

type Schema added in v0.31.0

type Schema interface {
	AssignType(typeable yamlmeta.Typeable) yamlmeta.TypeCheck
	// DefaultDataValues yields default values for Data Values...
	//   if schema was built by schema.NewNullSchema (i.e. no schema was provided), returns nil
	DefaultDataValues() *yamlmeta.Document
}

type TemplateLoader

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

func NewTemplateLoader

func NewTemplateLoader(values *DataValues, libraryValuess []*DataValues, librarySchemas []*schema.DocumentSchemaEnvelope, opts TemplateLoaderOpts, libraryExecFactory *LibraryExecutionFactory, ui ui.UI) *TemplateLoader

func (*TemplateLoader) EvalStarlark

func (l *TemplateLoader) EvalStarlark(libraryCtx LibraryExecutionContext, file *files.File) (starlark.StringDict, error)

func (*TemplateLoader) EvalText

func (*TemplateLoader) EvalYAML

func (*TemplateLoader) FindCompiledTemplate

func (l *TemplateLoader) FindCompiledTemplate(path string) (*template.CompiledTemplate, error)

func (*TemplateLoader) Load

func (l *TemplateLoader) Load(thread *starlark.Thread, module string) (starlark.StringDict, error)

func (*TemplateLoader) ParseYAML added in v0.17.0

func (l *TemplateLoader) ParseYAML(file *files.File) (*yamlmeta.DocumentSet, error)

type TemplateLoaderOpts added in v0.12.0

type TemplateLoaderOpts struct {
	IgnoreUnknownComments   bool
	ImplicitMapKeyOverrides bool
	StrictYAML              bool
	SchemaEnabled           bool
}

func (TemplateLoaderOpts) Merge added in v0.31.0

type TemplateLoaderOptsOverrides added in v0.31.0

type TemplateLoaderOptsOverrides struct {
	IgnoreUnknownComments   *bool
	ImplicitMapKeyOverrides *bool
	StrictYAML              *bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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