overlay

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationNs structmeta.AnnotationNs = "overlay"

	AnnotationMerge   structmeta.AnnotationName = "overlay/merge" // default
	AnnotationRemove  structmeta.AnnotationName = "overlay/remove"
	AnnotationReplace structmeta.AnnotationName = "overlay/replace"
	AnnotationInsert  structmeta.AnnotationName = "overlay/insert" // array only
	AnnotationAppend  structmeta.AnnotationName = "overlay/append" // array only
	AnnotationAssert  structmeta.AnnotationName = "overlay/assert"

	AnnotationMatch              structmeta.AnnotationName = "overlay/match"
	AnnotationMatchChildDefaults structmeta.AnnotationName = "overlay/match-child-defaults"
)

Variables

View Source
var (
	API = starlark.StringDict{
		"overlay": &starlarkstruct.Module{
			Name: "overlay",
			Members: starlark.StringDict{
				"apply":   starlark.NewBuiltin("overlay.apply", core.ErrWrapper(overlayModule{}.Apply)),
				"index":   starlark.NewBuiltin("overlay.index", core.ErrWrapper(overlayModule{}.Index)),
				"all":     starlark.NewBuiltin("overlay.all", core.ErrWrapper(overlayModule{}.All)),
				"map_key": starlark.NewBuiltin("overlay.map_key", core.ErrWrapper(overlayModule{}.MapKey)),
				"subset":  starlark.NewBuiltin("overlay.subset", core.ErrWrapper(overlayModule{}.Subset)),
			},
		},
	}
)

Functions

This section is empty.

Types

type ArrayItemMatchAnnotation

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

func NewArrayItemMatchAnnotation

func NewArrayItemMatchAnnotation(newItem *yamlmeta.ArrayItem,
	defaults MatchChildDefaultsAnnotation,
	thread *starlark.Thread) (ArrayItemMatchAnnotation, error)

func (ArrayItemMatchAnnotation) Indexes

func (a ArrayItemMatchAnnotation) Indexes(leftArray *yamlmeta.Array) ([]int, error)

func (ArrayItemMatchAnnotation) MatchNodes

func (a ArrayItemMatchAnnotation) MatchNodes(leftArray *yamlmeta.Array) ([]int, error)

type AssertAnnotation added in v0.24.0

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

func NewAssertAnnotation added in v0.24.0

func NewAssertAnnotation(newNode template.EvaluationNode, thread *starlark.Thread) (AssertAnnotation, error)

func (AssertAnnotation) Check added in v0.24.0

func (a AssertAnnotation) Check(existingNode template.EvaluationNode) error

type Comparison added in v0.24.0

type Comparison struct{}

func (Comparison) Compare added in v0.24.0

func (b Comparison) Compare(left, right interface{}) (bool, string)

func (Comparison) CompareLeafs added in v0.24.0

func (b Comparison) CompareLeafs(left, right interface{}) (bool, string)

type DocumentMatchAnnotation

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

func NewDocumentMatchAnnotation

func NewDocumentMatchAnnotation(newDoc *yamlmeta.Document,
	defaults MatchChildDefaultsAnnotation,
	exact bool, thread *starlark.Thread) (DocumentMatchAnnotation, error)

func (DocumentMatchAnnotation) IndexTuples

func (a DocumentMatchAnnotation) IndexTuples(leftDocSets []*yamlmeta.DocumentSet) ([][]int, error)

func (DocumentMatchAnnotation) MatchNodes

func (a DocumentMatchAnnotation) MatchNodes(leftDocSets []*yamlmeta.DocumentSet) ([][]int, error)

type InsertAnnotation

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

func NewInsertAnnotation

func NewInsertAnnotation(newItem template.EvaluationNode) (InsertAnnotation, error)

func (InsertAnnotation) IsAfter

func (a InsertAnnotation) IsAfter() bool

func (InsertAnnotation) IsBefore

func (a InsertAnnotation) IsBefore() bool

type MapItemMatchAnnotation

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

func NewMapItemMatchAnnotation

func NewMapItemMatchAnnotation(newItem *yamlmeta.MapItem,
	defaults MatchChildDefaultsAnnotation,
	thread *starlark.Thread) (MapItemMatchAnnotation, error)

func (MapItemMatchAnnotation) Index

func (a MapItemMatchAnnotation) Index(leftMap *yamlmeta.Map) (int, bool, error)

func (MapItemMatchAnnotation) MatchNode

func (a MapItemMatchAnnotation) MatchNode(leftMap *yamlmeta.Map) (int, bool)

type MatchAnnotationExpectsKwarg

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

func (MatchAnnotationExpectsKwarg) Check

func (a MatchAnnotationExpectsKwarg) Check(num int) error

func (*MatchAnnotationExpectsKwarg) FillInDefaults added in v0.20.0

func (a *MatchAnnotationExpectsKwarg) FillInDefaults(defaults MatchChildDefaultsAnnotation)

type MatchChildDefaultsAnnotation added in v0.20.0

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

func NewEmptyMatchChildDefaultsAnnotation added in v0.20.0

func NewEmptyMatchChildDefaultsAnnotation() MatchChildDefaultsAnnotation

func NewMatchChildDefaultsAnnotation added in v0.20.0

func NewMatchChildDefaultsAnnotation(node template.EvaluationNode,
	parentMatchChildDefaults MatchChildDefaultsAnnotation) (MatchChildDefaultsAnnotation, error)

type OverlayOp

type OverlayOp struct {
	Left  interface{}
	Right interface{}

	Thread *starlark.Thread

	ExactMatch bool
}

func (OverlayOp) Apply

func (o OverlayOp) Apply() (interface{}, error)

type ReplaceAnnotation added in v0.19.0

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

func NewReplaceAnnotation added in v0.19.0

func NewReplaceAnnotation(newNode template.EvaluationNode, thread *starlark.Thread) (ReplaceAnnotation, error)

func (ReplaceAnnotation) Value added in v0.19.0

func (a ReplaceAnnotation) Value(existingNode template.EvaluationNode) (interface{}, error)

Jump to

Keyboard shortcuts

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