pruning

package
Version: v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Prune

func Prune(obj interface{}, s *structuralschema.Structural, isResourceRoot bool)

Prune is equivalent to PruneWithOptions(obj, s, isResourceRoot, PruneOptions{})

func PruneWithOptions added in v0.23.0

func PruneWithOptions(obj interface{}, s *structuralschema.Structural, isResourceRoot bool, opts PruneOptions) []string

PruneWithOptions removes object fields in obj which are not specified in s. It skips TypeMeta and ObjectMeta fields if XEmbeddedResource is set to true, or for the root if isResourceRoot=true, i.e. it does not prune unknown metadata fields. It returns the set of fields that it prunes if opts.ReturnPruned is true

Types

type PruneOptions added in v0.23.0

type PruneOptions struct {

	// ReturnPruned defines whether we want to track the
	// fields that are pruned
	ReturnPruned bool
	// contains filtered or unexported fields
}

PruneOptions sets options for pruning unknown fields

Source Files

Jump to

Keyboard shortcuts

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